mirror of
https://github.com/GTNewHorizons/MouseTweaks.git
synced 2026-11-26 23:03:05 +00:00
Fixed a crash bug, more cleanups.
This commit is contained in:
1 parent
8cd22558f9
commit
3236afc46c
6 files changed
+20
-25
No files matched your search
+7
-6
@@ -16,8 +16,9 @@ buildscript {
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'curseforge'
|
||||
|
||||
version = "2.4.1"
|
||||
version = "2.4.2"
|
||||
group = "yalter.mousetweaks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "MouseTweaks"
|
||||
|
||||
@@ -32,10 +33,8 @@ processResources
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
include 'litemod.json'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
@@ -44,11 +43,13 @@ processResources
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
exclude 'litemod.json'
|
||||
}
|
||||
}
|
||||
|
||||
// Thanks to the IronChest repository for those.
|
||||
def propertiesFile = new File(destinationDir, 'version.properties')
|
||||
def properties = new Properties()
|
||||
properties['MouseTweaks.version'] = project.version
|
||||
properties.store(propertiesFile.newWriter(), null)
|
||||
}
|
||||
|
||||
jar {
|
||||
exclude 'com/**'
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#Tue May 06 21:57:37 CEST 2014
|
||||
#Tue Jun 03 23:08:53 MSK 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -2,13 +2,6 @@ package yalter.mousetweaks;
|
||||
|
||||
public class Constants
|
||||
{
|
||||
|
||||
// Mod name
|
||||
public static final String NAME = "Mouse Tweaks";
|
||||
|
||||
// Mod version
|
||||
public static final String VERSION = "2.4.1";
|
||||
|
||||
// Obfuscated names
|
||||
public static final String ISMOUSEOVERSLOT_NAME = "a";
|
||||
public static final String FIELDE_NAME = "H";
|
||||
|
||||
@@ -129,8 +129,7 @@ public class Main extends DeobfuscationLayer
|
||||
if ( returnValue )
|
||||
{
|
||||
ModCompatibility.initialize();
|
||||
Logger.Log( Constants.NAME + " version " + Constants.VERSION
|
||||
+ " has been initialised" );
|
||||
Logger.Log( "Mouse Tweaks has been initialised" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -371,6 +370,10 @@ public class Main extends DeobfuscationLayer
|
||||
if ( ( wheel != 0 ) && ( selectedSlot != null ) )
|
||||
{
|
||||
int numItemsToMove = Math.abs( wheel );
|
||||
if ( Debug == 1 )
|
||||
{
|
||||
Logger.Log("numItemsToMove: " + numItemsToMove);
|
||||
}
|
||||
|
||||
if ( slotCount > Constants.INVENTORY_SIZE )
|
||||
{
|
||||
@@ -489,6 +492,8 @@ public class Main extends DeobfuscationLayer
|
||||
|
||||
if ( wheel < 0 )
|
||||
{
|
||||
numItemsToMove = Math.min(numItemsToMove, getItemStackSize(stackFrom));
|
||||
|
||||
if ( ( stackTo != null )
|
||||
&& ( ( getMaxItemStackSize( stackTo ) - getItemStackSize( stackTo ) ) <= numItemsToMove ) )
|
||||
{
|
||||
@@ -496,8 +501,7 @@ public class Main extends DeobfuscationLayer
|
||||
clickSlot( currentScreen, slotTo, 0, false );
|
||||
clickSlot( currentScreen, slotFrom, 0, false );
|
||||
|
||||
numItemsToMove -= getMaxItemStackSize( stackTo )
|
||||
- getItemStackSize( stackTo );
|
||||
numItemsToMove -= getMaxItemStackSize( stackTo ) - getItemStackSize( stackTo );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -532,7 +536,7 @@ public class Main extends DeobfuscationLayer
|
||||
{
|
||||
clickSlot( currentScreen, slotFrom, 0, false );
|
||||
|
||||
if ( stackFrom.stackSize <= numItemsToMove )
|
||||
if ( getItemStackSize( stackFrom ) <= numItemsToMove )
|
||||
{
|
||||
clickSlot( currentScreen, slotTo, 0, false );
|
||||
numItemsToMove -= getMaxItemStackSize( stackFrom );
|
||||
|
||||
@@ -6,11 +6,8 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
|
||||
@Mod(modid = MouseTweaksForge.MODID, version = MouseTweaksForge.VERSION, useMetadata = true)
|
||||
@Mod(modid = "MouseTweaks", useMetadata = true)
|
||||
public class MouseTweaksForge {
|
||||
public static final String MODID = "MouseTweaks";
|
||||
public static final String VERSION = Constants.VERSION;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
{
|
||||
"modid": "MouseTweaks",
|
||||
"name": "Mouse Tweaks",
|
||||
"description": "Have you ever been tired of right clicking while crafting furnaces, chests or whatever? My client-side mod solves this problem! Just hold your right mouse button in one inventory slot and drag your mouse toward another. Also works with left mouse button! Credits: LiteLoader and some mods' source code, which I used as a reference to how to do certain stuff when I was unsure.",
|
||||
"description": "A mod that enhances the inventory management by adding various additional functions to the usual mouse buttons.",
|
||||
"version": "${version}",
|
||||
"mcversion": "${mcversion}",
|
||||
"url": "http://www.minecraftforum.net/topic/1518185-",
|
||||
"updateUrl": "",
|
||||
"authorList": [ "YaLTeR" ],
|
||||
"credits": "In the description.",
|
||||
"credits": "Various open-source mods from where I learned.",
|
||||
"logoFile": "/mousetweaks_logo.png",
|
||||
"screenshots": [ ],
|
||||
"dependencies": [ ]
|
||||
|
||||
Reference in new issue
Block a user