diff --git a/.gitignore b/.gitignore index 0daa1c5..c149166 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,10 @@ # eclipse +bin *.launch -/.settings -/.metadata -/.classpath -/.project -/eclipse +.settings +.metadata +.classpath +.project # idea out @@ -18,9 +18,14 @@ build .gradle # other -/bin +eclipse +run +saves +screenshots logs +config crash-reports +world whitelist.json usercache.json usernamecache.json @@ -34,4 +39,4 @@ CREDITS-fml.txt forge-*changelog.txt LICENSE-fml.txt MinecraftForge-*.txt -README.txt +README.txt \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index d49c609..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -# [The MIT License (MIT)](https://sites.google.com/site/furglsmods/licensing) - -Copyright (c) 2016 Jake Pollard - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 07f56f6..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# [AutoPickup](https://sites.google.com/site/furglsmods/auto-pickup) -Auto Pickup allows items to be picked up automatically or blacklisted and never picked up. Whenever you do something that creates an item, that item will be automatically placed in your inventory (if it is not in your blacklist). Experience will also be given to you automatically. This works with all modded items! diff --git a/build.gradle b/build.gradle index 70bb07c..1b6e93f 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-2.0" +version = "1.7.10-2.1" group= "furgl.autoPickup" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "AutoPickup" diff --git a/eula.txt b/eula.txt new file mode 100644 index 0000000..47c5a4e --- /dev/null +++ b/eula.txt @@ -0,0 +1,3 @@ +#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula). +#Thu Sep 01 14:04:53 CDT 2016 +eula=true diff --git a/src/main/java/furgl/autoPickup/AutoPickup.java b/src/main/java/furgl/autoPickup/AutoPickup.java index 31e2a6a..8bebe5c 100644 --- a/src/main/java/furgl/autoPickup/AutoPickup.java +++ b/src/main/java/furgl/autoPickup/AutoPickup.java @@ -1,11 +1,9 @@ package furgl.autoPickup; -import org.lwjgl.input.Keyboard; - -import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; @@ -17,7 +15,6 @@ import furgl.autoPickup.event.EntityJoinWorldEvents; import furgl.autoPickup.event.ItemTossEvents; import furgl.autoPickup.event.PlaySoundAtEntityEvents; -import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; @@ -27,10 +24,11 @@ public class AutoPickup { public static final String MODID = "autopickup"; public static final String MODNAME = "AutoPickup"; - public static final String VERSION = "2.0"; + public static final String VERSION = "2.1"; public static SimpleNetworkWrapper network; - public static KeyBinding ignoreBlacklist = new KeyBinding("Ignore Blacklist", Keyboard.KEY_LMENU, "Auto Pickup"); + @SidedProxy(clientSide = "furgl.autoPickup.ClientProxy", serverSide = "furgl.autoPickup.CommonProxy") + public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) @@ -44,7 +42,7 @@ public void preInit(FMLPreInitializationEvent event) @EventHandler public void init(FMLInitializationEvent event) { - ClientRegistry.registerKeyBinding(ignoreBlacklist); + AutoPickup.proxy.init(); } diff --git a/src/main/java/furgl/autoPickup/ClientProxy.java b/src/main/java/furgl/autoPickup/ClientProxy.java new file mode 100644 index 0000000..8aa80f3 --- /dev/null +++ b/src/main/java/furgl/autoPickup/ClientProxy.java @@ -0,0 +1,16 @@ +package furgl.autoPickup; + +import org.lwjgl.input.Keyboard; + +import cpw.mods.fml.client.registry.ClientRegistry; +import net.minecraft.client.settings.KeyBinding; + +public class ClientProxy extends CommonProxy +{ + public KeyBinding ignoreBlacklist = new KeyBinding("Ignore Blacklist", Keyboard.KEY_LMENU, "Auto Pickup"); + + public void init() + { + ClientRegistry.registerKeyBinding(ignoreBlacklist); + } +} diff --git a/src/main/java/furgl/autoPickup/CommandBlacklist.java b/src/main/java/furgl/autoPickup/CommandBlacklist.java index d2e7d2e..5156bec 100644 --- a/src/main/java/furgl/autoPickup/CommandBlacklist.java +++ b/src/main/java/furgl/autoPickup/CommandBlacklist.java @@ -51,11 +51,11 @@ private static Collection convertToDisplayNames(Set set) { try { - Item item = getItemByText(null, (String) iterator.next()); + Item item = getItemByText(null, (String) iterator.next());/* ArrayList subItems = new ArrayList(); item.getSubItems(item, item.getCreativeTab(), subItems); - for (ItemStack stack : subItems) - displayNames.add((String) item.getItemStackDisplayName(stack).replace(" ", "_")); + for (ItemStack stack : subItems)*/ + displayNames.add((String) item.getItemStackDisplayName(new ItemStack(item)).replace(" ", "_")); } catch (Exception e) { diff --git a/src/main/java/furgl/autoPickup/CommonProxy.java b/src/main/java/furgl/autoPickup/CommonProxy.java new file mode 100644 index 0000000..4f2c9ab --- /dev/null +++ b/src/main/java/furgl/autoPickup/CommonProxy.java @@ -0,0 +1,9 @@ +package furgl.autoPickup; + +public class CommonProxy +{ + public void init() + { + + } +} diff --git a/src/main/java/furgl/autoPickup/IgnoreKey.java b/src/main/java/furgl/autoPickup/IgnoreKey.java index 864c63e..be1ff4d 100644 --- a/src/main/java/furgl/autoPickup/IgnoreKey.java +++ b/src/main/java/furgl/autoPickup/IgnoreKey.java @@ -21,9 +21,9 @@ public void playerTick(PlayerTickEvent event) { if (event.side == Side.CLIENT && event.phase == Phase.START) { - if ((AutoPickup.ignoreBlacklist.isPressed() || AutoPickup.ignoreBlacklist.getIsKeyPressed()) != isPressed) + if ((((ClientProxy)AutoPickup.proxy).ignoreBlacklist.isPressed() || ((ClientProxy)AutoPickup.proxy).ignoreBlacklist.getIsKeyPressed()) != isPressed) { - isPressed = AutoPickup.ignoreBlacklist.isPressed() || AutoPickup.ignoreBlacklist.getIsKeyPressed(); + isPressed = ((ClientProxy)AutoPickup.proxy).ignoreBlacklist.isPressed() || ((ClientProxy)AutoPickup.proxy).ignoreBlacklist.getIsKeyPressed(); AutoPickup.network.sendToServer(new PacketIgnoreKey(isPressed)); } } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 14eece3..bea1710 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "autopickup", "name": "AutoPickup", "description": "Allows items to be picked up automatically or blacklisted and never picked up.", - "version": "2.0", + "version": "2.1", "mcversion": "1.7.10", "url": "https://sites.google.com/site/furglsmods/auto-pickup", "updateUrl": "",