diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..963076e --- /dev/null +++ b/build.gradle @@ -0,0 +1,64 @@ +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" + } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' + } +} + +apply plugin: 'forge' + +version = "2.4.0" +group= "yalter.mousetweaks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "MouseTweaks" + +minecraft { + version = "1.7.2-10.12.0.1039" + assetDir = "eclipse/assets" +} +processResources +{ + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} + +// Thanks to the IronChest repository for those. + +jar { + version = "${project.minecraft.version}-${project.version}" +} + +task sourceJar(type: Jar) { + from sourceSets.main.allSource + classifier = 'src' + version = "${project.minecraft.version}-${project.version}" +} + +task deobfJar(type: Jar) { + from sourceSets.main.output + classifier = 'deobf' + version = "${project.minecraft.version}-${project.version}" +} + +artifacts { + archives sourceJar, deobfJar +} diff --git a/net/minecraft/src/mod_MouseTweaks.java b/net/minecraft/src/mod_MouseTweaks.java deleted file mode 100644 index 529ad5b..0000000 --- a/net/minecraft/src/mod_MouseTweaks.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.minecraft.src; - -import net.minecraft.client.Minecraft; -import yalter.mousetweaks.Constants; -import yalter.mousetweaks.Main; - -public class mod_MouseTweaks extends BaseMod { - - @Override - public String getName() { - return Constants.NAME; - } - - @Override - public String getVersion() { - return Constants.VERSION; - } - - @Override - public void load() { - if (!Main.initialise()) - return; - - if (!Main.useModLoader) - return; - - ModLoader.setInGameHook(this, true, true); - } - - @Override - public boolean onTickInGame(float clock, Minecraft minecraft) { - Main.onUpdateInGame(); - return true; - } - -} diff --git a/yalter/mousetweaks/Config.java b/src/main/java/yalter/mousetweaks/Config.java similarity index 97% rename from yalter/mousetweaks/Config.java rename to src/main/java/yalter/mousetweaks/Config.java index ecdfaad..830cebe 100644 --- a/yalter/mousetweaks/Config.java +++ b/src/main/java/yalter/mousetweaks/Config.java @@ -11,7 +11,7 @@ import java.util.Iterator; public class Config { private String fileName; - private HashMap Properties = new HashMap(); + private HashMap Properties = new HashMap(); public Config( String fileName ) { diff --git a/yalter/mousetweaks/Constants.java b/src/main/java/yalter/mousetweaks/Constants.java similarity index 71% rename from yalter/mousetweaks/Constants.java rename to src/main/java/yalter/mousetweaks/Constants.java index f8d16e1..b820626 100644 --- a/yalter/mousetweaks/Constants.java +++ b/src/main/java/yalter/mousetweaks/Constants.java @@ -7,13 +7,19 @@ public class Constants public static final String NAME = "Mouse Tweaks"; // Mod version - public static final String VERSION = "2.3.5 (for Minecraft 1.6.4)"; + public static final String VERSION = "2.4.0"; // Obfuscated names public static final String ISMOUSEOVERSLOT_NAME = "a"; - public static final String FIELDE_NAME = "G"; - public static final String FIELDq_NAME = "s"; - public static final String MCPROFILER_NAME = "C"; + public static final String FIELDE_NAME = "H"; + public static final String FIELDq_NAME = "t"; + public static final String MCPROFILER_NAME = "A"; + + // Forge obfuscated names + public static final String ISMOUSEOVERSLOT_FORGE_NAME = "func_146981_a"; + public static final String FIELDE_FORGE_NAME = "field_146995_H"; + public static final String FIELDq_FORGE_NAME = "field_147007_t"; + public static final String MCPROFILER_FORGE_NAME = "field_71424_I"; // Inventory-related stuff public static final int INVENTORY_SIZE = 36; // Size of the player inventory @@ -27,6 +33,4 @@ public class Constants public static final int CODECHICKENCORE = 4; // CodeChickenCore containers. public static final int NEI = 5; // NotEnoughItems containers (like the crafting menu). - public static final boolean DEBUG = false; // Debug mode (writing many stuff into STDOUT) - } diff --git a/yalter/mousetweaks/DeobfuscationLayer.java b/src/main/java/yalter/mousetweaks/DeobfuscationLayer.java similarity index 84% rename from yalter/mousetweaks/DeobfuscationLayer.java rename to src/main/java/yalter/mousetweaks/DeobfuscationLayer.java index 4271d98..19fd02c 100644 --- a/yalter/mousetweaks/DeobfuscationLayer.java +++ b/src/main/java/yalter/mousetweaks/DeobfuscationLayer.java @@ -2,22 +2,23 @@ package yalter.mousetweaks; import java.util.List; -import net.minecraft.src.Container; -import net.minecraft.src.ContainerFurnace; -import net.minecraft.src.ContainerPlayer; -import net.minecraft.src.ContainerRepair; -import net.minecraft.src.ContainerWorkbench; -import net.minecraft.src.EntityClientPlayerMP; -import net.minecraft.src.GameSettings; -import net.minecraft.src.GuiContainer; -import net.minecraft.src.GuiContainerCreative; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.InventoryPlayer; -import net.minecraft.src.ItemStack; -import net.minecraft.src.Minecraft; -import net.minecraft.src.PlayerControllerMP; -import net.minecraft.src.ScaledResolution; -import net.minecraft.src.Slot; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ContainerFurnace; +import net.minecraft.inventory.ContainerPlayer; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiContainerCreative; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.PlayerControllerMP; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.inventory.Slot; import org.lwjgl.input.Mouse; @@ -90,7 +91,7 @@ public class DeobfuscationLayer protected static int getItemStackID( ItemStack itemStack ) { - return itemStack.itemID; + return Item.getIdFromItem( itemStack.getItem() ); } protected static boolean hasSubtypesItemStack( ItemStack itemStack ) @@ -180,11 +181,8 @@ public class DeobfuscationLayer protected static boolean isMouseOverSlot( GuiContainer guiContainer, Slot slot ) { - boolean returnValue = false; - returnValue = ( Boolean ) Reflection.guiContainerClass.invokeMethod( guiContainer, + return ( Boolean ) Reflection.guiContainerClass.invokeMethod( guiContainer, "isMouseOverSlot", slot, getRequiredMouseX(), getRequiredMouseY() ); - - return returnValue; } protected static Slot getSelectedSlot( GuiContainer guiContainer, Container container, int slotCount ) @@ -206,8 +204,8 @@ public class DeobfuscationLayer */ public static void disableVanillaRMBDrag( GuiContainer guiContainer ) { - Reflection.guiContainerClass.setFieldValue( guiContainer, "field_94068_E", true ); - Reflection.guiContainerClass.setFieldValue( guiContainer, "field_94076_q", false ); + Reflection.guiContainerClass.setFieldValue( guiContainer, Constants.FIELDE_FORGE_NAME, true ); + Reflection.guiContainerClass.setFieldValue( guiContainer, Constants.FIELDq_FORGE_NAME, false ); } protected static int getRequiredMouseX() @@ -215,9 +213,7 @@ public class DeobfuscationLayer ScaledResolution var8 = new ScaledResolution( getGameSettings(), getDisplayWidth(), getDisplayHeight() ); int var9 = var8.getScaledWidth(); - int var11 = ( Mouse.getX() * var9 ) / getDisplayWidth(); - - return var11; + return ( Mouse.getX() * var9 ) / getDisplayWidth(); } protected static int getRequiredMouseY() @@ -225,9 +221,7 @@ public class DeobfuscationLayer ScaledResolution var8 = new ScaledResolution( getGameSettings(), getDisplayWidth(), getDisplayHeight() ); int var10 = var8.getScaledHeight(); - int var13 = var10 - ( ( Mouse.getY() * var10 ) / getDisplayHeight() ) - 1; - - return var13; + return var10 - ( ( Mouse.getY() * var10 ) / getDisplayHeight() ) - 1; } protected static void sendClientMessage( String message ) diff --git a/yalter/mousetweaks/Logger.java b/src/main/java/yalter/mousetweaks/Logger.java similarity index 100% rename from yalter/mousetweaks/Logger.java rename to src/main/java/yalter/mousetweaks/Logger.java diff --git a/yalter/mousetweaks/Main.java b/src/main/java/yalter/mousetweaks/Main.java similarity index 94% rename from yalter/mousetweaks/Main.java rename to src/main/java/yalter/mousetweaks/Main.java index eef8347..95dde7a 100644 --- a/yalter/mousetweaks/Main.java +++ b/src/main/java/yalter/mousetweaks/Main.java @@ -2,10 +2,10 @@ package yalter.mousetweaks; import java.io.File; -import net.minecraft.src.Minecraft; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.ItemStack; -import net.minecraft.src.Slot; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.Slot; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -32,7 +32,7 @@ public class Main extends DeobfuscationLayer public static boolean liteLoader = false; public static boolean minecraftForge = false; public static boolean optifine = false; - public static boolean modLoader = false; +// public static boolean modLoader = false; public static boolean useModLoader = false; public static boolean DisableRMBTweak = false; @@ -43,6 +43,8 @@ public class Main extends DeobfuscationLayer public static int WheelTweak = 0; public static int ForceModLoader = 0; public static int WheelSearchOrder = 1; + + public static int Debug = 0; public static Config mainConfig; @@ -62,27 +64,32 @@ public class Main extends DeobfuscationLayer + File.separator + "MouseTweaks.cfg" ); readConfigFile(); - modLoader = Reflection.doesClassExist( "net.minecraft.src.ModLoader" ); +// modLoader = Reflection.doesClassExist( "net.minecraft.src.ModLoader" ); minecraftForge = Reflection .doesClassExist( "net.minecraftforge.client.MinecraftForgeClient" ); if ( ForceModLoader == 1 ) { - if ( modLoader ) - { - useModLoader = true; - Logger.Log( "ForceModLoader is set to 1, using ModLoader's onTick for mod operation..." ); - } - else - { - Logger.Log( "ForceModLoader is set to 1, but ModLoader's main class is not present, quitting..." ); - disabled = true; - return false; - } +// if ( modLoader ) +// { +// useModLoader = true; +// Logger.Log( "ForceModLoader is set to 1, using ModLoader's onTick for mod operation..." ); +// } +// else +// { +// Logger.Log( "ForceModLoader is set to 1, but ModLoader's main class is not present, quitting..." ); +// disabled = true; +// return false; +// } + + Logger.Log("ForceModLoader is not supported yet, quitting..."); + disabled = true; + return false; } else { - liteLoader = Reflection.reflectLiteLoader(); +// liteLoader = Reflection.reflectLiteLoader(); + liteLoader = false; optifine = Reflection.reflectOptifine(); } @@ -102,23 +109,27 @@ public class Main extends DeobfuscationLayer { if ( !Reflection.replaceProfiler() ) { - if ( modLoader ) - { - useModLoader = true; - Logger.Log( "Using ModLoader for mod operation" ); - } - else - { - Logger.Log( "Failed to replace Minecraft profiler, quitting" ); - +// if ( modLoader ) +// { +// useModLoader = true; +// Logger.Log( "Using ModLoader for mod operation" ); +// } +// else +// { + Logger.Log( "Failed to replace the Minecraft profiler, quitting..." ); + disabled = true; return false; - } +// } } } else { - Logger.Log( "Using ModLoader for mod operation" ); +// Logger.Log( "Using ModLoader for mod operation" ); + + Logger.Log("Failed to reflect Minecraft, quitting..."); + disabled = true; + return false; } } @@ -148,6 +159,7 @@ public class Main extends DeobfuscationLayer mainConfig.setPropertyValue( "WheelTweak", 1 ); mainConfig.setPropertyValue( "WheelSearchOrder", 1 ); mainConfig.setPropertyValue( "ForceModLoader", 0 ); + mainConfig.setPropertyValue( "Debug", 0 ); mainConfig.saveConfig(); @@ -160,6 +172,7 @@ public class Main extends DeobfuscationLayer WheelTweak = mainConfig.getOrCreatePropertyValue( "WheelTweak", 1 ); WheelSearchOrder = mainConfig.getOrCreatePropertyValue( "WheelSearchOrder", 1 ); ForceModLoader = mainConfig.getOrCreatePropertyValue( "ForceModLoader", 0 ); + Debug = mainConfig.getOrCreatePropertyValue( "Debug", 0 ); mainConfig.saveConfig(); } @@ -217,7 +230,7 @@ public class Main extends DeobfuscationLayer container = getContainerWithID( currentScreen ); disableForThisContainer = isDisabledForThisContainer( currentScreen ); - if ( Constants.DEBUG ) + if ( Debug == 1 ) { Logger.Log( new StringBuilder().append( "You have just opened a " ).append( getGuiContainerNameFromID( currentScreen ) ).append( " container (" ).append( currentScreen.getClass().getSimpleName() ).append( ( container == null ) ? "" : "; " ).append( ( container == null ) ? "" : container.getClass().getSimpleName() ).append( "), which has " ).append( getSlotCountWithID( currentScreen ) ).append( " slots!" ).toString() ); } @@ -293,7 +306,7 @@ public class Main extends DeobfuscationLayer return; } - if ( Constants.DEBUG ) + if ( Debug == 1 ) { Logger.Log( new StringBuilder().append( "You have selected a new slot, it's slot number is " ).append( getSlotNumber( selectedSlot ) ).toString() ); } diff --git a/yalter/mousetweaks/ModCompatibility.java b/src/main/java/yalter/mousetweaks/ModCompatibility.java similarity index 99% rename from yalter/mousetweaks/ModCompatibility.java rename to src/main/java/yalter/mousetweaks/ModCompatibility.java index ad6c4da..acc5b85 100644 --- a/yalter/mousetweaks/ModCompatibility.java +++ b/src/main/java/yalter/mousetweaks/ModCompatibility.java @@ -1,8 +1,8 @@ package yalter.mousetweaks; import yalter.mousetweaks.api.IMTModGuiContainer; -import net.minecraft.src.GuiScreen; -import net.minecraft.src.Slot; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.inventory.Slot; public class ModCompatibility extends DeobfuscationLayer { diff --git a/src/main/java/yalter/mousetweaks/MouseTweaksForge.java b/src/main/java/yalter/mousetweaks/MouseTweaksForge.java new file mode 100644 index 0000000..d94efce --- /dev/null +++ b/src/main/java/yalter/mousetweaks/MouseTweaksForge.java @@ -0,0 +1,17 @@ +package yalter.mousetweaks; + +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import net.minecraft.init.Blocks; + +@Mod(modid = MouseTweaksForge.MODID, version = MouseTweaksForge.VERSION, 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) + { + Main.initialise(); + } +} diff --git a/yalter/mousetweaks/ProfilerCustom.java b/src/main/java/yalter/mousetweaks/ProfilerCustom.java similarity index 80% rename from yalter/mousetweaks/ProfilerCustom.java rename to src/main/java/yalter/mousetweaks/ProfilerCustom.java index 525ad6c..71ddcf0 100644 --- a/yalter/mousetweaks/ProfilerCustom.java +++ b/src/main/java/yalter/mousetweaks/ProfilerCustom.java @@ -1,7 +1,7 @@ package yalter.mousetweaks; -import net.minecraft.src.Minecraft; -import net.minecraft.src.Profiler; +import net.minecraft.client.Minecraft; +import net.minecraft.profiler.Profiler; public class ProfilerCustom extends Profiler { @@ -30,10 +30,4 @@ public class ProfilerCustom extends Profiler } } } - - @Override - public void endSection() - { - super.endSection(); - } } diff --git a/yalter/mousetweaks/Reflection.java b/src/main/java/yalter/mousetweaks/Reflection.java similarity index 85% rename from yalter/mousetweaks/Reflection.java rename to src/main/java/yalter/mousetweaks/Reflection.java index 6cd3f29..4b155a9 100644 --- a/yalter/mousetweaks/Reflection.java +++ b/src/main/java/yalter/mousetweaks/Reflection.java @@ -4,11 +4,11 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import net.minecraft.src.Minecraft; -import net.minecraft.src.GameSettings; -import net.minecraft.src.GuiContainer; -import net.minecraft.src.Slot; -import net.minecraft.src.Tessellator; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.GameSettings; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; +import net.minecraft.client.renderer.Tessellator; public class Reflection { @@ -21,6 +21,9 @@ public class Reflection public static ReflectionCache forestry; public static ReflectionCache codechickencore; public static ReflectionCache NEI; + + private static boolean isObfuscated = false; + private static boolean checkObfuscation = true; public static boolean reflectGuiContainer() { @@ -28,7 +31,7 @@ public class Reflection guiContainerClass.storeClass( "GuiContainer", GuiContainer.class ); Method isMouseOverSlot = getMethod( GuiContainer.class, - getObfuscatedName( "isMouseOverSlot", "func_74186_a", Constants.ISMOUSEOVERSLOT_NAME ), Slot.class, int.class, + getObfuscatedName( "isMouseOverSlot", Constants.ISMOUSEOVERSLOT_FORGE_NAME, Constants.ISMOUSEOVERSLOT_NAME ), Slot.class, int.class, int.class ); if ( isMouseOverSlot == null ) @@ -41,28 +44,28 @@ public class Reflection Field field; field = getField( GuiContainer.class, - getObfuscatedName( "field_94068_E", "field_94068_E", Constants.FIELDE_NAME ) ); + getObfuscatedName( Constants.FIELDE_FORGE_NAME, Constants.FIELDE_FORGE_NAME, Constants.FIELDE_NAME ) ); if ( field == null ) { - Logger.Log( "Failed to retrieve field_94068_E, disabling RMBTweak" ); + Logger.Log( "Failed to retrieve the E field, disabling RMBTweak" ); Main.DisableRMBTweak = true; } else { - guiContainerClass.storeField( "field_94068_E", field ); + guiContainerClass.storeField( Constants.FIELDE_FORGE_NAME, field ); field = getField( GuiContainer.class, - getObfuscatedName( "field_94076_q", "field_94076_q", Constants.FIELDq_NAME ) ); + getObfuscatedName( Constants.FIELDq_FORGE_NAME, Constants.FIELDq_FORGE_NAME, Constants.FIELDq_NAME ) ); if ( field == null ) { - Logger.Log( "Failed to retreive field_94076_q, disabling RMBTweak" ); + Logger.Log( "Failed to retreive the q field, disabling RMBTweak" ); Main.DisableRMBTweak = true; } else { - guiContainerClass.storeField( "field_94076_q", field ); + guiContainerClass.storeField( Constants.FIELDq_FORGE_NAME, field ); } } @@ -96,7 +99,7 @@ public class Reflection Object liteLoaderInstance = liteLoaderClass.invokeStaticMethod( "LiteLoader", "getInstance" ); if ( liteLoaderInstance != null ) { - Class mouseTweaks = getClass( "MouseTweaks.LiteModMouseTweaks" ); + Class mouseTweaks = getClass( "yalter.mousetweaks.LiteModMouseTweaks" ); if ( mouseTweaks != null ) { liteModMouseTweaks = new ReflectionCache(); @@ -168,7 +171,7 @@ public class Reflection minecraft = new ReflectionCache(); minecraft.storeClass( "Minecraft", Minecraft.class ); - Field profilerField = getFinalField( Minecraft.class, getObfuscatedName( "mcProfiler", "field_71424_I", Constants.MCPROFILER_NAME ) ); + Field profilerField = getFinalField( Minecraft.class, getObfuscatedName( "mcProfiler", Constants.MCPROFILER_FORGE_NAME, Constants.MCPROFILER_NAME ) ); if ( profilerField != null ) { minecraft.storeField( "mcProfiler", profilerField ); @@ -322,7 +325,11 @@ public class Reflection { Logger.Log( "Could not retrieve field \"" + name + "\" from class \"" + clazz.getName() + "\"" ); - e.printStackTrace(); + + if ( Main.Debug == 1 ) + { + e.printStackTrace(); + } } } @@ -361,13 +368,17 @@ public class Reflection { Logger.Log( "Could not retrieve field \"" + name + "\" from class \"" + clazz.getName() + "\"" ); - e.printStackTrace(); + + if ( Main.Debug == 1 ) + { + e.printStackTrace(); + } } return null; } - public static Method getMethod( Class clazz, String name, Class... args ) + public static Method getMethod( Class clazz, String name, Class... args ) { try { @@ -401,7 +412,11 @@ public class Reflection { Logger.Log( "Could not retrieve method \"" + name + "\" from class \"" + clazz.getName() + "\"" ); - e.printStackTrace(); + + if ( Main.Debug == 1 ) + { + e.printStackTrace(); + } } return null; @@ -409,13 +424,26 @@ public class Reflection public static String methodToString( Method method ) { - return ( Modifier.toString( method.getModifiers() ) + " " + method.getReturnType() ) != null ? method - .getReturnType().getName() : "void" + " " + method.getName(); + return Modifier.toString( method.getModifiers() ) + " " + ( ( method.getReturnType() != null ) ? method + .getReturnType().getName() : "void" ) + " " + method.getName(); } public static String getObfuscatedName( String mcpName, String forgeName, String originalName ) { - return Main.minecraftForge ? forgeName : Tessellator.instance.getClass().getSimpleName() - .equals( "Tessellator" ) ? mcpName : originalName; + if (checkObfuscation) + { + checkObfuscation(); + } + + return isObfuscated ? ( Main.minecraftForge ? forgeName : originalName ) : mcpName; +} + + public static void checkObfuscation() + { + checkObfuscation = false; + + Logger.Log("Obfuscation check, please ignore the following isMouseOverSlot error (if it comes up)."); + isObfuscated = getMethod( GuiContainer.class, "isMouseOverSlot", Slot.class, int.class, int.class ) == null; + Logger.Log("Obfuscation check completed."); } } diff --git a/yalter/mousetweaks/ReflectionCache.java b/src/main/java/yalter/mousetweaks/ReflectionCache.java similarity index 92% rename from yalter/mousetweaks/ReflectionCache.java rename to src/main/java/yalter/mousetweaks/ReflectionCache.java index 3980162..74e0382 100644 --- a/yalter/mousetweaks/ReflectionCache.java +++ b/src/main/java/yalter/mousetweaks/ReflectionCache.java @@ -8,9 +8,9 @@ public class ReflectionCache { public boolean available = false; public boolean compatible = false; - public HashMap classes = new HashMap(); - public HashMap methods = new HashMap(); - public HashMap fields = new HashMap(); + public HashMap classes = new HashMap(); + public HashMap methods = new HashMap(); + public HashMap fields = new HashMap(); public ReflectionCache() { diff --git a/yalter/mousetweaks/api/IMTModGuiContainer.java b/src/main/java/yalter/mousetweaks/api/IMTModGuiContainer.java similarity index 95% rename from yalter/mousetweaks/api/IMTModGuiContainer.java rename to src/main/java/yalter/mousetweaks/api/IMTModGuiContainer.java index 83bebbc..49f9269 100644 --- a/yalter/mousetweaks/api/IMTModGuiContainer.java +++ b/src/main/java/yalter/mousetweaks/api/IMTModGuiContainer.java @@ -1,7 +1,14 @@ package yalter.mousetweaks.api; public interface IMTModGuiContainer { - + + /** + * Returns the API version. + * + * @return API version. Should return 1 for this version. + */ + public int getAPIVersion(); + /** * Returns a mod name to use in log messages. * diff --git a/mcmod.info b/src/main/resources/mcmod.info similarity index 85% rename from mcmod.info rename to src/main/resources/mcmod.info index 1978a26..becd7e2 100644 --- a/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,17 +1,16 @@ [ { - "modid": "mod_MouseTweaks", + "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", - "version": "2.3.5", - "mcversion": "1.6.4", + "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.", + "version": "${version}", + "mcversion": "${mcversion}", "url": "http://www.minecraftforum.net/topic/1518185-", "updateUrl": "", "authors": [ "YaLTeR" ], "credits": "In the description.", "logoFile": "/mousetweaks_logo.png", "screenshots": [ ], - "parent":"", "dependencies": [ ] } ] \ No newline at end of file diff --git a/mousetweaks_logo.png b/src/main/resources/mousetweaks_logo.png similarity index 100% rename from mousetweaks_logo.png rename to src/main/resources/mousetweaks_logo.png diff --git a/version.txt b/version.txt deleted file mode 100644 index 6463e95..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.6.4 \ No newline at end of file diff --git a/yalter/mousetweaks/LiteModMouseTweaks.java b/yalter/mousetweaks/LiteModMouseTweaks.java deleted file mode 100644 index c7e8096..0000000 --- a/yalter/mousetweaks/LiteModMouseTweaks.java +++ /dev/null @@ -1,67 +0,0 @@ -package MouseTweaks; - -import java.io.File; - -import net.minecraft.src.GuiScreen; - -import com.mumfrey.liteloader.RenderListener; - -public class LiteModMouseTweaks implements RenderListener -{ - - private static LiteModMouseTweaks instance; - - public static LiteModMouseTweaks getInstance() - { - if ( instance == null ) - { - instance = new LiteModMouseTweaks(); - } - - return instance; - } - - @Override - public String getName() - { - return Constants.NAME; - } - - @Override - public String getVersion() - { - return Constants.VERSION; - } - - @Override - public void onRender() - { - Main.onUpdateInGame(); - } - - @Override - public void onRenderGui( GuiScreen currentScreen ) - { - } - - @Override - public void onRenderWorld() - { - } - - @Override - public void onSetupCameraTransform() - { - } - - @Override - public void init( File configPath ) - { - Main.initialise(); - } - - @Override - public void upgradeSettings( String version, File configPath, File oldConfigPath ) - { - } -}