diff --git a/src/main/java/thaumic/tinkerer/api/INoRemoveEnchant.java b/src/main/java/thaumic/tinkerer/api/INoRemoveEnchant.java index 030f792e..837dd0a2 100644 --- a/src/main/java/thaumic/tinkerer/api/INoRemoveEnchant.java +++ b/src/main/java/thaumic/tinkerer/api/INoRemoveEnchant.java @@ -1,17 +1,15 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 01:21:51 (GMT)] */ package thaumic.tinkerer.api; -public interface INoRemoveEnchant {} +public interface INoRemoveEnchant { +} diff --git a/src/main/java/thaumic/tinkerer/api/InterModCommsOperations.java b/src/main/java/thaumic/tinkerer/api/InterModCommsOperations.java index 9fa81cc3..2b82cbec 100644 --- a/src/main/java/thaumic/tinkerer/api/InterModCommsOperations.java +++ b/src/main/java/thaumic/tinkerer/api/InterModCommsOperations.java @@ -4,6 +4,7 @@ package thaumic.tinkerer.api; * Created by Katrina on 16/04/14. */ public class InterModCommsOperations { + public static final String ADD_RESEARCH_BLACKLIST = "AddResearchBlacklist"; public static final String ADD_CC_BLACKLIST = "AddCCBlacklist"; } diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/ClientTickHandler.java b/src/main/java/thaumic/tinkerer/client/core/handler/ClientTickHandler.java index ba1a96d6..df55447f 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/ClientTickHandler.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/ClientTickHandler.java @@ -1,29 +1,27 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [13 Sep 2013, 15:00:40 (GMT)] */ package thaumic.tinkerer.client.core.handler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.relauncher.ReflectionHelper; import net.minecraft.client.Minecraft; + import thaumcraft.api.research.ResearchItem; import thaumcraft.client.gui.GuiResearchRecipe; import thaumic.tinkerer.client.core.handler.kami.ToolModeHUDHandler; import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.gui.GuiResearchPeripheral; import thaumic.tinkerer.common.lib.LibResearch; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.ReflectionHelper; public class ClientTickHandler { @@ -33,11 +31,10 @@ public class ClientTickHandler { public void tickEnd(TickEvent event) { if (event.phase == TickEvent.Phase.END) { Minecraft mc = ClientHelper.minecraft(); - if (mc.currentScreen != null - && mc.currentScreen instanceof GuiResearchRecipe + if (mc.currentScreen != null && mc.currentScreen instanceof GuiResearchRecipe && !(mc.currentScreen instanceof GuiResearchPeripheral)) { - ResearchItem research = ReflectionHelper.getPrivateValue( - GuiResearchRecipe.class, (GuiResearchRecipe) mc.currentScreen, 9); + ResearchItem research = ReflectionHelper + .getPrivateValue(GuiResearchRecipe.class, (GuiResearchRecipe) mc.currentScreen, 9); if (research.key.equals(LibResearch.KEY_PERIPHERALS) || research.key.equals(LibResearch.KEY_GOLEMCONNECTOR)) mc.displayGuiScreen(new GuiResearchPeripheral(research)); diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/GemArmorKeyHandler.java b/src/main/java/thaumic/tinkerer/client/core/handler/GemArmorKeyHandler.java index c95a265f..af4af06b 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/GemArmorKeyHandler.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/GemArmorKeyHandler.java @@ -1,17 +1,19 @@ package thaumic.tinkerer.client.core.handler; +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.KeyBinding; + +import org.lwjgl.input.Keyboard; + +import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler; +import thaumic.tinkerer.common.ThaumicTinkerer; +import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.Minecraft; -import net.minecraft.client.settings.KeyBinding; -import org.lwjgl.input.Keyboard; -import thaumic.tinkerer.client.core.handler.kami.KamiArmorClientHandler; -import thaumic.tinkerer.common.ThaumicTinkerer; -import thaumic.tinkerer.common.item.kami.armor.ItemIchorclothArmorAdv; /** * Created by Katrina on 28/02/14. @@ -29,32 +31,19 @@ public class GemArmorKeyHandler { @SubscribeEvent public void keyUp(InputEvent.KeyInputEvent event) { if (SpecialAbility.isPressed()) { - if ((Minecraft.getMinecraft().thePlayer.getCurrentArmor(0) != null - && Minecraft.getMinecraft() - .thePlayer - .getCurrentArmor(0) - .getItem() - instanceof ItemIchorclothArmorAdv) + if ((Minecraft.getMinecraft().thePlayer.getCurrentArmor(0) != null && Minecraft.getMinecraft().thePlayer + .getCurrentArmor(0).getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(1) != null - && Minecraft.getMinecraft() - .thePlayer - .getCurrentArmor(1) - .getItem() - instanceof ItemIchorclothArmorAdv) + && Minecraft.getMinecraft().thePlayer.getCurrentArmor(1) + .getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(2) != null - && Minecraft.getMinecraft() - .thePlayer - .getCurrentArmor(2) - .getItem() - instanceof ItemIchorclothArmorAdv) + && Minecraft.getMinecraft().thePlayer.getCurrentArmor(2) + .getItem() instanceof ItemIchorclothArmorAdv) || (Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) != null - && Minecraft.getMinecraft() - .thePlayer - .getCurrentArmor(3) - .getItem() - instanceof ItemIchorclothArmorAdv)) { - KamiArmorClientHandler.SetStatus( - !ThaumicTinkerer.proxy.armorStatus(ThaumicTinkerer.proxy.getClientPlayer())); + && Minecraft.getMinecraft().thePlayer.getCurrentArmor(3) + .getItem() instanceof ItemIchorclothArmorAdv)) { + KamiArmorClientHandler + .SetStatus(!ThaumicTinkerer.proxy.armorStatus(ThaumicTinkerer.proxy.getClientPlayer())); } } } diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/HUDHandler.java b/src/main/java/thaumic/tinkerer/client/core/handler/HUDHandler.java index ac1df0df..763f031a 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/HUDHandler.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/HUDHandler.java @@ -1,20 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [10 Sep 2013, 12:16:36 (GMT)] */ package thaumic.tinkerer.client.core.handler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.entity.RenderItem; @@ -26,11 +22,13 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; + import thaumcraft.api.wands.ItemFocusBasic; import thaumcraft.common.config.Config; import thaumcraft.common.items.wands.ItemWandCasting; import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.common.item.foci.ItemFocusDislocation; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public final class HUDHandler { diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/kami/KamiArmorClientHandler.java b/src/main/java/thaumic/tinkerer/client/core/handler/kami/KamiArmorClientHandler.java index 2a2c7b41..d3fea979 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/kami/KamiArmorClientHandler.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/kami/KamiArmorClientHandler.java @@ -1,9 +1,10 @@ package thaumic.tinkerer.client.core.handler.kami; -import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.util.StatCollector; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor; +import cpw.mods.fml.client.FMLClientHandler; /** * Created by Katrina on 02/03/14. diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/kami/PlacementMirrorPredictionRenderer.java b/src/main/java/thaumic/tinkerer/client/core/handler/kami/PlacementMirrorPredictionRenderer.java index 9c76f4de..d02f611c 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/kami/PlacementMirrorPredictionRenderer.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/kami/PlacementMirrorPredictionRenderer.java @@ -1,7 +1,7 @@ package thaumic.tinkerer.client.core.handler.kami; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; @@ -13,9 +13,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.item.kami.ItemPlacementMirror; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public final class PlacementMirrorPredictionRenderer { @@ -40,8 +43,10 @@ public final class PlacementMirrorPredictionRenderer { private void renderPlayerLook(EntityPlayer player, ItemStack stack) { ChunkCoordinates[] coords = ItemPlacementMirror.getBlocksToPlace(stack, player); if (ItemPlacementMirror.hasBlocks(stack, player, coords)) { - ItemStack block = - new ItemStack(ItemPlacementMirror.getBlock(stack), 1, ItemPlacementMirror.getBlockMeta(stack)); + ItemStack block = new ItemStack( + ItemPlacementMirror.getBlock(stack), + 1, + ItemPlacementMirror.getBlockMeta(stack)); ChunkCoordinates lastCoords = new ChunkCoordinates(0, 0, 0); GL11.glPushMatrix(); diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/kami/SoulHeartClientHandler.java b/src/main/java/thaumic/tinkerer/client/core/handler/kami/SoulHeartClientHandler.java index a29c7b82..4fe4a3c5 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/kami/SoulHeartClientHandler.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/kami/SoulHeartClientHandler.java @@ -1,23 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 9:35:38 PM (GMT)] */ package thaumic.tinkerer.client.core.handler.kami; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; @@ -26,8 +19,13 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; + import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.core.handler.ConfigHandler; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public final class SoulHeartClientHandler { @@ -56,36 +54,17 @@ public final class SoulHeartClientHandler { } /* - @SideOnly(Side.CLIENT) - @SubscribeEvent - public void renderHealthBar(RenderGameOverlayEvent event) { - if (event.type == ElementType.FOOD && clientPlayerHP > 0) { - if (event instanceof RenderGameOverlayEvent.Post) { - Minecraft mc = Minecraft.getMinecraft(); - - int x = event.resolution.getScaledWidth() / 2 + 10; - int y = event.resolution.getScaledHeight() - 39; - - //GL11.glTranslatef(0F, 10F, 0F); - mc.renderEngine.bindTexture(heartsResource); - int it = 0; - for (int i = 0; i < clientPlayerHP; i++) { - boolean half = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0; - if (half || i % 2 == 0) { - renderHeart(x + it * 8, y, !half); - it++; - } - } - - mc.renderEngine.bindTexture(iconsResource); - } - - //GL11.glTranslatef(0F, -10F, 0F); - } - - //if (event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0) - //GL11.glTranslatef(0F, 10F, 0F); - }*/ + * @SideOnly(Side.CLIENT) + * @SubscribeEvent public void renderHealthBar(RenderGameOverlayEvent event) { if (event.type == ElementType.FOOD && + * clientPlayerHP > 0) { if (event instanceof RenderGameOverlayEvent.Post) { Minecraft mc = + * Minecraft.getMinecraft(); int x = event.resolution.getScaledWidth() / 2 + 10; int y = + * event.resolution.getScaledHeight() - 39; //GL11.glTranslatef(0F, 10F, 0F); + * mc.renderEngine.bindTexture(heartsResource); int it = 0; for (int i = 0; i < clientPlayerHP; i++) { boolean half + * = i == clientPlayerHP - 1 && clientPlayerHP % 2 != 0; if (half || i % 2 == 0) { renderHeart(x + it * 8, y, + * !half); it++; } } mc.renderEngine.bindTexture(iconsResource); } //GL11.glTranslatef(0F, -10F, 0F); } //if + * (event.type == ElementType.AIR && event instanceof RenderGameOverlayEvent.Post && clientPlayerHP > 0) + * //GL11.glTranslatef(0F, 10F, 0F); } + */ @SubscribeEvent(priority = EventPriority.HIGHEST) public void onDrawScreenPre(RenderGameOverlayEvent.Pre event) { diff --git a/src/main/java/thaumic/tinkerer/client/core/handler/kami/ToolModeHUDHandler.java b/src/main/java/thaumic/tinkerer/client/core/handler/kami/ToolModeHUDHandler.java index 1095a54d..342ed326 100644 --- a/src/main/java/thaumic/tinkerer/client/core/handler/kami/ToolModeHUDHandler.java +++ b/src/main/java/thaumic/tinkerer/client/core/handler/kami/ToolModeHUDHandler.java @@ -1,31 +1,31 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 11:38:29 PM (GMT)] */ package thaumic.tinkerer.client.core.handler.kami; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.util.MathHelper; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.core.handler.ClientTickHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public final class ToolModeHUDHandler { @@ -47,8 +47,7 @@ public final class ToolModeHUDHandler { @SubscribeEvent @SideOnly(Side.CLIENT) public void drawDislocationFocusHUD(RenderGameOverlayEvent.Post event) { - if (event.type == ElementType.ALL - && tooltipDisplayTicks > 0 + if (event.type == ElementType.ALL && tooltipDisplayTicks > 0 && !MathHelper.stringNullOrLengthZero(currentTooltip)) { Minecraft mc = Minecraft.getMinecraft(); ScaledResolution var5 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); diff --git a/src/main/java/thaumic/tinkerer/client/core/helper/ClientHelper.java b/src/main/java/thaumic/tinkerer/client/core/helper/ClientHelper.java index 0ec6b27c..bfe1e7ab 100644 --- a/src/main/java/thaumic/tinkerer/client/core/helper/ClientHelper.java +++ b/src/main/java/thaumic/tinkerer/client/core/helper/ClientHelper.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 18:11:25 (GMT)] @@ -15,10 +12,12 @@ package thaumic.tinkerer.client.core.helper; import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.Tessellator; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; diff --git a/src/main/java/thaumic/tinkerer/client/core/helper/IconHelper.java b/src/main/java/thaumic/tinkerer/client/core/helper/IconHelper.java index ed660eb7..91a68991 100644 --- a/src/main/java/thaumic/tinkerer/client/core/helper/IconHelper.java +++ b/src/main/java/thaumic/tinkerer/client/core/helper/IconHelper.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 15:47:08 (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.util.IIcon; + import thaumic.tinkerer.client.lib.LibResources; public class IconHelper { diff --git a/src/main/java/thaumic/tinkerer/client/core/proxy/TTClientProxy.java b/src/main/java/thaumic/tinkerer/client/core/proxy/TTClientProxy.java index 94620ed1..28e8f7f4 100644 --- a/src/main/java/thaumic/tinkerer/client/core/proxy/TTClientProxy.java +++ b/src/main/java/thaumic/tinkerer/client/core/proxy/TTClientProxy.java @@ -1,26 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:33:54 (GMT)] */ package thaumic.tinkerer.client.core.proxy; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.relauncher.Side; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -29,6 +19,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.EnumHelperClient; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; + import thaumcraft.client.fx.ParticleEngine; import thaumic.tinkerer.client.core.handler.ClientTickHandler; import thaumic.tinkerer.client.core.handler.GemArmorKeyHandler; @@ -62,6 +53,13 @@ import thaumic.tinkerer.common.item.ItemInfusedSeeds; import thaumic.tinkerer.common.item.ItemMobDisplay; import thaumic.tinkerer.common.item.kami.ItemPlacementMirror; import thaumic.tinkerer.common.item.kami.foci.ItemFocusShadowbeam; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.relauncher.Side; public class TTClientProxy extends TTCommonProxy { @@ -79,7 +77,7 @@ public class TTClientProxy extends TTCommonProxy { if (ConfigHandler.enableKami) // kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami"); kamiRarity = EnumHelperClient.addEnum( - new Class[][] {{EnumRarity.class, EnumChatFormatting.class, String.class}}, + new Class[][] { { EnumRarity.class, EnumChatFormatting.class, String.class } }, EnumRarity.class, "KAMI", EnumChatFormatting.LIGHT_PURPLE, @@ -129,9 +127,11 @@ public class TTClientProxy extends TTCommonProxy { RenderingRegistry.registerBlockHandler(new RenderRepairer()); MinecraftForgeClient.registerItemRenderer( - ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class), new RenderMobDisplay()); + ThaumicTinkerer.registry.getFirstItemFromClass(ItemMobDisplay.class), + new RenderMobDisplay()); MinecraftForgeClient.registerItemRenderer( - ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class), new RenderGenericSeeds()); + ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class), + new RenderGenericSeeds()); if (ConfigHandler.enableKami) { MinecraftForgeClient.registerItemRenderer( @@ -148,7 +148,15 @@ public class TTClientProxy extends TTCommonProxy { @Override public void shadowSparkle(World world, float x, float y, float z, int size) { ItemFocusShadowbeam.Particle fx = new ItemFocusShadowbeam.Particle( - world, (double) x, (double) y, (double) z, size, 0.001f, 0.001f, 0.001f, 5); + world, + (double) x, + (double) y, + (double) z, + size, + 0.001f, + 0.001f, + 0.001f, + 5); ParticleEngine.instance.addEffect(world, fx); } diff --git a/src/main/java/thaumic/tinkerer/client/gui/GuiAnimationTablet.java b/src/main/java/thaumic/tinkerer/client/gui/GuiAnimationTablet.java index bdd9201c..add9e279 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/GuiAnimationTablet.java +++ b/src/main/java/thaumic/tinkerer/client/gui/GuiAnimationTablet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:31:14 (GMT)] @@ -16,12 +13,15 @@ package thaumic.tinkerer.client.gui; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.gui.button.GuiButtonAT; import thaumic.tinkerer.client.gui.button.GuiButtonATRadio; import thaumic.tinkerer.client.gui.button.IRadioButton; @@ -85,8 +85,8 @@ public class GuiAnimationTablet extends GuiContainer { fontRendererObj.drawString(left, x + 48 - fontRendererObj.getStringWidth(left), y + 18, 0x999999); fontRendererObj.drawString(right, x + 128, y + 18, 0x999999); - fontRendererObj.drawString( - redstone, x + xSize / 2 - fontRendererObj.getStringWidth(redstone) / 2, y + 50, 0x999999); + fontRendererObj + .drawString(redstone, x + xSize / 2 - fontRendererObj.getStringWidth(redstone) / 2, y + 50, 0x999999); GL11.glColor3f(1F, 1F, 1F); } } diff --git a/src/main/java/thaumic/tinkerer/client/gui/GuiAspectAnalyzer.java b/src/main/java/thaumic/tinkerer/client/gui/GuiAspectAnalyzer.java index d1f9ce80..1a4f681f 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/GuiAspectAnalyzer.java +++ b/src/main/java/thaumic/tinkerer/client/gui/GuiAspectAnalyzer.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 10:46:14 PM (GMT)] @@ -16,12 +13,15 @@ package thaumic.tinkerer.client.gui; import java.util.Arrays; import java.util.List; + import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.client.lib.UtilsFX; @@ -65,8 +65,7 @@ public class GuiAspectAnalyzer extends GuiContainer { if (stack != null) { int h = ScanManager.generateItemHash(stack.getItem(), stack.getItemDamage()); - List list = Thaumcraft.proxy - .getScannedObjects() + List list = Thaumcraft.proxy.getScannedObjects() .get(ClientHelper.clientPlayer().getGameProfile().getName()); if (list != null && (list.contains("@" + h) || list.contains("#" + h))) { AspectList tags = ThaumcraftCraftingManager.getObjectTags(stack); @@ -89,13 +88,12 @@ public class GuiAspectAnalyzer extends GuiContainer { @Override protected void drawGuiContainerForegroundLayer(int mx, int my) { - if (aspectHovered != null) - ClientHelper.renderTooltip( - mx - x, - my - y, - Arrays.asList( - EnumChatFormatting.AQUA + aspectHovered.getName(), - EnumChatFormatting.GRAY + aspectHovered.getLocalizedDescription())); + if (aspectHovered != null) ClientHelper.renderTooltip( + mx - x, + my - y, + Arrays.asList( + EnumChatFormatting.AQUA + aspectHovered.getName(), + EnumChatFormatting.GRAY + aspectHovered.getLocalizedDescription())); super.drawGuiContainerForegroundLayer(mx, my); } diff --git a/src/main/java/thaumic/tinkerer/client/gui/GuiEnchanting.java b/src/main/java/thaumic/tinkerer/client/gui/GuiEnchanting.java index 94381e77..ca07748f 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/GuiEnchanting.java +++ b/src/main/java/thaumic/tinkerer/client/gui/GuiEnchanting.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [15 Sep 2013, 00:58:22 (GMT)] @@ -17,13 +14,16 @@ package thaumic.tinkerer.client.gui; import java.awt.*; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.gui.button.GuiButtonEnchant; @@ -111,8 +111,8 @@ public class GuiEnchanting extends GuiContainer { for (int enchant : EnchantmentManager.enchantmentData.keySet()) { if (currentStack.getItem().getItemEnchantability() != 0 - && EnchantmentManager.canApply( - currentStack, Enchantment.enchantmentsList[enchant], enchanter.enchantments) + && EnchantmentManager + .canApply(currentStack, Enchantment.enchantmentsList[enchant], enchanter.enchantments) && EnchantmentManager.canEnchantmentBeUsed( ClientHelper.clientPlayer().getGameProfile().getName(), Enchantment.enchantmentsList[enchant])) { @@ -130,9 +130,8 @@ public class GuiEnchanting extends GuiContainer { ThaumicTinkerer.netHandler.sendToServer(new PacketEnchanterStartWorking(enchanter)); } else if (par1GuiButton.id <= 16) { GuiButtonEnchantment button = enchantButtons[par1GuiButton.id - 1]; - if (button != null && button.enchant != null) - ThaumicTinkerer.netHandler.sendToServer( - new PacketEnchanterAddEnchant(enchanter, button.enchant.effectId, 0)); + if (button != null && button.enchant != null) ThaumicTinkerer.netHandler + .sendToServer(new PacketEnchanterAddEnchant(enchanter, button.enchant.effectId, 0)); } else { int type = (par1GuiButton.id - 17) % 3; int index = (par1GuiButton.id - 17) / 3; @@ -145,8 +144,8 @@ public class GuiEnchanting extends GuiContainer { switch (type) { case 0: { - ThaumicTinkerer.netHandler.sendToServer( - new PacketEnchanterAddEnchant(enchanter, enchant.effectId, -1)); + ThaumicTinkerer.netHandler + .sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, -1)); break; } case 1: { @@ -155,8 +154,8 @@ public class GuiEnchanting extends GuiContainer { break; } case 2: { - ThaumicTinkerer.netHandler.sendToServer( - new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level + 1)); + ThaumicTinkerer.netHandler + .sendToServer(new PacketEnchanterAddEnchant(enchanter, enchant.effectId, level + 1)); break; } } @@ -169,9 +168,9 @@ public class GuiEnchanting extends GuiContainer { public void updateScreen() { currentStack = enchanter.getStackInSlot(0); buildButtonList(); - if (currentStack != lastTickStack - || !lastTickEnchants.equals(enchanter.enchantments) - || !lastTickLevels.equals(enchanter.levels)) buildButtonList(); + if (currentStack != lastTickStack || !lastTickEnchants.equals(enchanter.enchantments) + || !lastTickLevels.equals(enchanter.levels)) + buildButtonList(); lastTickStack = currentStack; lastTickEnchants = new ArrayList(enchanter.enchantments); diff --git a/src/main/java/thaumic/tinkerer/client/gui/GuiMobMagnet.java b/src/main/java/thaumic/tinkerer/client/gui/GuiMobMagnet.java index 12ae951e..56481c7a 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/GuiMobMagnet.java +++ b/src/main/java/thaumic/tinkerer/client/gui/GuiMobMagnet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:37:02 (GMT)] @@ -16,13 +13,16 @@ package thaumic.tinkerer.client.gui; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.gui.button.GuiButtonMM; import thaumic.tinkerer.client.gui.button.GuiButtonMMRadio; import thaumic.tinkerer.client.gui.button.IRadioButton; @@ -93,8 +93,8 @@ public class GuiMobMagnet extends GuiContainer { else filter = StatCollector.translateToLocal("entity." + name + ".name"); } else filter = StatCollector.translateToLocal("ttmisc.all"); - fontRendererObj.drawString( - filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999); + fontRendererObj + .drawString(filter, x + xSize / 2 - fontRendererObj.getStringWidth(filter) / 2 - 26, y + 16, 0x999999); fontRendererObj.drawString(adult, x + 120, y + 30, 0x999999); fontRendererObj.drawString(child, x + 120, y + 50, 0x999999); GL11.glColor3f(1F, 1F, 1F); diff --git a/src/main/java/thaumic/tinkerer/client/gui/GuiRemotePlacer.java b/src/main/java/thaumic/tinkerer/client/gui/GuiRemotePlacer.java index 7bf346c3..6bbf55fb 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/GuiRemotePlacer.java +++ b/src/main/java/thaumic/tinkerer/client/gui/GuiRemotePlacer.java @@ -2,11 +2,14 @@ package thaumic.tinkerer.client.gui; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumic.tinkerer.client.gui.button.GuiButtonRP; import thaumic.tinkerer.client.gui.button.GuiButtonRPRadio; @@ -21,6 +24,7 @@ import thaumic.tinkerer.common.network.packet.PacketPlacerButton; * Created by nekosune on 30/06/14. */ public class GuiRemotePlacer extends GuiContainer { + private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_ASPECT_ANALYZER); int x, y; diff --git a/src/main/java/thaumic/tinkerer/client/gui/GuiResearchPeripheral.java b/src/main/java/thaumic/tinkerer/client/gui/GuiResearchPeripheral.java index 322254a8..d34ba0f7 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/GuiResearchPeripheral.java +++ b/src/main/java/thaumic/tinkerer/client/gui/GuiResearchPeripheral.java @@ -1,26 +1,25 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [13 Sep 2013, 14:50:41 (GMT)] */ package thaumic.tinkerer.client.gui; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.awt.*; import java.net.URI; + import net.minecraft.util.StatCollector; + import thaumcraft.api.research.ResearchItem; import thaumcraft.client.gui.GuiResearchRecipe; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiResearchPeripheral extends GuiResearchRecipe { diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonAT.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonAT.java index aa43d813..353215d4 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonAT.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonAT.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:33:24 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; + import thaumic.tinkerer.client.lib.LibResources; public class GuiButtonAT extends GuiButton { diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonATRadio.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonATRadio.java index fa857c79..b3dff2be 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonATRadio.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonATRadio.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:33:43 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchant.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchant.java index 561f6e32..c2a3a295 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchant.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchant.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 21:56:21 (GMT)] @@ -16,11 +13,13 @@ package thaumic.tinkerer.client.gui.button; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.gui.GuiEnchanting; import thaumic.tinkerer.client.lib.LibResources; @@ -48,8 +47,7 @@ public class GuiButtonEnchant extends GuiButton { ClientHelper.minecraft().renderEngine.bindTexture(gui); drawTexturedModalRect(xPosition, yPosition, x, y, 15, 15); - if (par2 >= xPosition - && par2 < xPosition + 15 + if (par2 >= xPosition && par2 < xPosition + 15 && par3 >= yPosition && par3 < yPosition + 15 && !enchanter.working) { diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchanterLevel.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchanterLevel.java index 623cd0dc..5a2c6cb2 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchanterLevel.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchanterLevel.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [16 Sep 2013, 16:13:50 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; + import thaumic.tinkerer.client.lib.LibResources; public class GuiButtonEnchanterLevel extends GuiButton { diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchantment.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchantment.java index beed6748..21797e96 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchantment.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonEnchantment.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [15 Sep 2013, 00:13:10 (GMT)] @@ -16,13 +13,16 @@ package thaumic.tinkerer.client.gui.button; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.Tessellator; import net.minecraft.enchantment.Enchantment; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.gui.GuiEnchanting; @@ -47,8 +47,7 @@ public class GuiButtonEnchantment extends GuiButton { public void drawButton(Minecraft par1Minecraft, int par2, int par3) { if (dontRender()) return; - EnchantmentData data = - EnchantmentManager.enchantmentData.get(enchant.effectId).get(1); + EnchantmentData data = EnchantmentManager.enchantmentData.get(enchant.effectId).get(1); ClientHelper.minecraft().renderEngine.bindTexture(data.texture); GL11.glEnable(GL11.GL_BLEND); drawTexturedModalRect16(xPosition, yPosition, 0, 0, 16, 16); @@ -57,12 +56,19 @@ public class GuiButtonEnchantment extends GuiButton { if (par2 >= xPosition && par2 < xPosition + 16 && par3 >= yPosition && par3 < yPosition + 16) { List tooltip = new ArrayList(); tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(enchant.getName())); - for (Aspect aspect : data.aspects.getAspectsSorted()) - tooltip.add(" \u00a7" + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " - + data.aspects.getAmount(aspect) + " " + StatCollector.translateToLocal("ttmisc.baseCost")); - if (this instanceof GuiButtonFramedEnchantment && !parent.enchanter.working) - tooltip.add(EnumChatFormatting.GRAY + "" + EnumChatFormatting.ITALIC + " " - + StatCollector.translateToLocal("ttmisc.clickToRemove")); + for (Aspect aspect : data.aspects.getAspectsSorted()) tooltip.add( + " \u00a7" + aspect.getChatcolor() + + aspect.getName() + + '\u00a7' + + "r x " + + data.aspects.getAmount(aspect) + + " " + + StatCollector.translateToLocal("ttmisc.baseCost")); + if (this instanceof GuiButtonFramedEnchantment && !parent.enchanter.working) tooltip.add( + EnumChatFormatting.GRAY + "" + + EnumChatFormatting.ITALIC + + " " + + StatCollector.translateToLocal("ttmisc.clickToRemove")); parent.tooltip = tooltip; } diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonFramedEnchantment.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonFramedEnchantment.java index e88695f3..adb35a28 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonFramedEnchantment.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonFramedEnchantment.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [16 Sep 2013, 15:31:55 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button; import net.minecraft.client.Minecraft; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.gui.GuiEnchanting; import thaumic.tinkerer.client.lib.LibResources; diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMM.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMM.java index 656960b4..a239861a 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMM.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMM.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:39:55 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; + import thaumic.tinkerer.client.lib.LibResources; public class GuiButtonMM extends GuiButton { diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMMRadio.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMMRadio.java index 68a31535..e64d8da9 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMMRadio.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonMMRadio.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:40:22 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRP.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRP.java index baf3f70f..81389bd4 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRP.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRP.java @@ -3,12 +3,14 @@ package thaumic.tinkerer.client.gui.button; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; + import thaumic.tinkerer.client.lib.LibResources; /** * Created by nekosune on 30/06/14. */ public class GuiButtonRP extends GuiButton { + private static final ResourceLocation gui = new ResourceLocation(LibResources.GUI_REMOTE_PLACER); public boolean buttonEnabled = false; diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRPRadio.java b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRPRadio.java index a3bee892..e0ee4d29 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRPRadio.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/GuiButtonRPRadio.java @@ -6,6 +6,7 @@ import java.util.List; * Created by nekosune on 30/06/14. */ public class GuiButtonRPRadio extends GuiButtonRP implements IRadioButton { + List linkedButtons; public GuiButtonRPRadio(int par1, int par2, int par3, boolean enabled, List linkedButtons) { diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/IRadioButton.java b/src/main/java/thaumic/tinkerer/client/gui/button/IRadioButton.java index 6c0df9c5..f6c2a193 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/IRadioButton.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/IRadioButton.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:32:08 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/gui/button/kami/GuiButtonWG.java b/src/main/java/thaumic/tinkerer/client/gui/button/kami/GuiButtonWG.java index 9a5bfa18..5d7b0370 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/button/kami/GuiButtonWG.java +++ b/src/main/java/thaumic/tinkerer/client/gui/button/kami/GuiButtonWG.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 5:58:46 PM (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.button.kami; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; + import thaumic.tinkerer.client.lib.LibResources; public class GuiButtonWG extends GuiButton { diff --git a/src/main/java/thaumic/tinkerer/client/gui/kami/GuiIchorPouch.java b/src/main/java/thaumic/tinkerer/client/gui/kami/GuiIchorPouch.java index f9245913..b092c456 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/kami/GuiIchorPouch.java +++ b/src/main/java/thaumic/tinkerer/client/gui/kami/GuiIchorPouch.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 10:54:58 PM (GMT)] @@ -17,7 +14,9 @@ package thaumic.tinkerer.client.gui.kami; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.lib.LibResources; public class GuiIchorPouch extends GuiContainer { diff --git a/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGate.java b/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGate.java index 11251225..49e4edf9 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGate.java +++ b/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 5:43:53 PM (GMT)] @@ -19,7 +16,9 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.gui.button.kami.GuiButtonWG; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.ThaumicTinkerer; @@ -62,7 +61,7 @@ public class GuiWarpGate extends GuiContainer { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(gui); drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - fontRendererObj.drawStringWithShadow( - StatCollector.translateToLocal("ttmisc.lockedGate"), x + 20, y + 7, 0x999999); + fontRendererObj + .drawStringWithShadow(StatCollector.translateToLocal("ttmisc.lockedGate"), x + 20, y + 7, 0x999999); } } diff --git a/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGateDestinations.java b/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGateDestinations.java index 66753306..d119aef6 100644 --- a/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGateDestinations.java +++ b/src/main/java/thaumic/tinkerer/client/gui/kami/GuiWarpGateDestinations.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 6:08:23 PM (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.client.gui.kami; import java.awt.*; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; @@ -26,8 +24,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; + import thaumcraft.codechicken.lib.vec.Vector3; import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.common.ThaumicTinkerer; @@ -91,8 +91,7 @@ public class GuiWarpGateDestinations extends GuiScreen { if (par2 >= 2 && par2 < 12) { int num = par2 - 2; ItemStack stack = warpGate.getStackInSlot(num); - if (stack != null - && ItemSkyPearl.isAttuned(stack) + if (stack != null && ItemSkyPearl.isAttuned(stack) && ItemSkyPearl.getDim(stack) == warpGate.getWorldObj().provider.dimensionId) { int x = ItemSkyPearl.getX(stack); int z = ItemSkyPearl.getZ(stack); @@ -126,7 +125,7 @@ public class GuiWarpGateDestinations extends GuiScreen { int y = ItemSkyPearl.getY(stack); int z = ItemSkyPearl.getZ(stack); - if (y != -1) coords.add(new Object[] {x - this.x, z - this.y, stack, i}); + if (y != -1) coords.add(new Object[] { x - this.x, z - this.y, stack, i }); } } @@ -148,24 +147,34 @@ public class GuiWarpGateDestinations extends GuiScreen { GL11.glDisable(GL11.GL_BLEND); fontRendererObj.drawStringWithShadow( - EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"), 3, 40, 0xFFFFFF); + EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"), + 3, + 40, + 0xFFFFFF); GL11.glColor4f(1F, 1F, 1F, 1F); drawPearlAt(0, null, gateX, gateY, par1, par2); - for (Object[] coords_ : coords) - drawPearlAt( - (Integer) coords_[3], - (ItemStack) coords_[2], - (Integer) coords_[0], - (Integer) coords_[1], - par1, - par2); + for (Object[] coords_ : coords) drawPearlAt( + (Integer) coords_[3], + (ItemStack) coords_[2], + (Integer) coords_[0], + (Integer) coords_[1], + par1, + par2); if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1, par2, tooltip); drawCenteredString( - fontRendererObj, StatCollector.translateToLocal("ttmisc.numberKeys"), width / 2, 5, 0xFFFFFF); + fontRendererObj, + StatCollector.translateToLocal("ttmisc.numberKeys"), + width / 2, + 5, + 0xFFFFFF); drawCenteredString( - fontRendererObj, StatCollector.translateToLocal("ttmisc.spaceToReset"), width / 2, 16, 0xFFFFFF); + fontRendererObj, + StatCollector.translateToLocal("ttmisc.spaceToReset"), + width / 2, + 16, + 0xFFFFFF); } public void drawPearlAt(int index, ItemStack stack, int xp, int yp, int mx, int my) { @@ -181,9 +190,7 @@ public class GuiWarpGateDestinations extends GuiScreen { render.renderIcon( -8, -8, - ThaumicTinkerer.registry - .getFirstItemFromClass(ItemSkyPearl.class) - .getIconFromDamage(0), + ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class).getIconFromDamage(0), 16, 16); GL11.glPopMatrix(); diff --git a/src/main/java/thaumic/tinkerer/client/lib/LibRenderIDs.java b/src/main/java/thaumic/tinkerer/client/lib/LibRenderIDs.java index bda5cfe0..ca78ab7d 100644 --- a/src/main/java/thaumic/tinkerer/client/lib/LibRenderIDs.java +++ b/src/main/java/thaumic/tinkerer/client/lib/LibRenderIDs.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:43:34 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/lib/LibResources.java b/src/main/java/thaumic/tinkerer/client/lib/LibResources.java index 610de8f6..4eada524 100644 --- a/src/main/java/thaumic/tinkerer/client/lib/LibResources.java +++ b/src/main/java/thaumic/tinkerer/client/lib/LibResources.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 17:38:36 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/model/ModelMagnet.java b/src/main/java/thaumic/tinkerer/client/model/ModelMagnet.java index 0a151f03..5e7e74b2 100644 --- a/src/main/java/thaumic/tinkerer/client/model/ModelMagnet.java +++ b/src/main/java/thaumic/tinkerer/client/model/ModelMagnet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:56:17 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/model/ModelRelay.java b/src/main/java/thaumic/tinkerer/client/model/ModelRelay.java index c6f4ec0e..c069d262 100644 --- a/src/main/java/thaumic/tinkerer/client/model/ModelRelay.java +++ b/src/main/java/thaumic/tinkerer/client/model/ModelRelay.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:56:17 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/model/ModelRepairer.java b/src/main/java/thaumic/tinkerer/client/model/ModelRepairer.java index a6658ae8..632111f6 100644 --- a/src/main/java/thaumic/tinkerer/client/model/ModelRepairer.java +++ b/src/main/java/thaumic/tinkerer/client/model/ModelRepairer.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:18:53 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/model/kami/ModelSpinningCubes.java b/src/main/java/thaumic/tinkerer/client/model/kami/ModelSpinningCubes.java index f8e028c9..de1aaf58 100644 --- a/src/main/java/thaumic/tinkerer/client/model/kami/ModelSpinningCubes.java +++ b/src/main/java/thaumic/tinkerer/client/model/kami/ModelSpinningCubes.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 4:41:02 PM (GMT)] @@ -17,7 +14,9 @@ package thaumic.tinkerer.client.model.kami; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.OpenGlHelper; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.core.helper.ClientHelper; public class ModelSpinningCubes extends ModelBase { diff --git a/src/main/java/thaumic/tinkerer/client/model/kami/ModelWings.java b/src/main/java/thaumic/tinkerer/client/model/kami/ModelWings.java index 49db4bfc..c408b8ea 100644 --- a/src/main/java/thaumic/tinkerer/client/model/kami/ModelWings.java +++ b/src/main/java/thaumic/tinkerer/client/model/kami/ModelWings.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 25, 2013, 00:18:06 PM (GMT)] diff --git a/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java b/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java index 5f6a062f..ad9512cb 100644 --- a/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java +++ b/src/main/java/thaumic/tinkerer/client/render/block/RenderInfusedCrops.java @@ -1,14 +1,16 @@ package thaumic.tinkerer.client.render.block; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.IBlockAccess; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumic.tinkerer.client.lib.LibRenderIDs; import thaumic.tinkerer.common.block.BlockInfusedGrain; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; /** * Created by pixlepix on 8/4/14. @@ -19,8 +21,8 @@ public class RenderInfusedCrops implements ISimpleBlockRenderingHandler { public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {} @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { GL11.glPushMatrix(); Aspect aspect = BlockInfusedGrain.getAspect(world, x, y, z); diff --git a/src/main/java/thaumic/tinkerer/client/render/block/RenderMagnet.java b/src/main/java/thaumic/tinkerer/client/render/block/RenderMagnet.java index ee4d1a34..be11b9f5 100644 --- a/src/main/java/thaumic/tinkerer/client/render/block/RenderMagnet.java +++ b/src/main/java/thaumic/tinkerer/client/render/block/RenderMagnet.java @@ -1,28 +1,27 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:08:42 (GMT)] */ package thaumic.tinkerer.client.render.block; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.world.IBlockAccess; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.lib.LibRenderIDs; import thaumic.tinkerer.client.render.tile.RenderTileMagnet; import thaumic.tinkerer.common.block.tile.TileMagnet; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class RenderMagnet implements ISimpleBlockRenderingHandler { @@ -37,8 +36,8 @@ public class RenderMagnet implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { return false; } diff --git a/src/main/java/thaumic/tinkerer/client/render/block/RenderRepairer.java b/src/main/java/thaumic/tinkerer/client/render/block/RenderRepairer.java index ad2ffa04..0e50d753 100644 --- a/src/main/java/thaumic/tinkerer/client/render/block/RenderRepairer.java +++ b/src/main/java/thaumic/tinkerer/client/render/block/RenderRepairer.java @@ -1,27 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 30, 2013, 5:50:21 PM (GMT)] */ package thaumic.tinkerer.client.render.block; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.world.IBlockAccess; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.lib.LibRenderIDs; import thaumic.tinkerer.common.block.tile.TileRepairer; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class RenderRepairer implements ISimpleBlockRenderingHandler { @@ -34,8 +33,8 @@ public class RenderRepairer implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { return false; } diff --git a/src/main/java/thaumic/tinkerer/client/render/block/kami/RenderWarpGate.java b/src/main/java/thaumic/tinkerer/client/render/block/kami/RenderWarpGate.java index 2cd60378..d501f7d0 100644 --- a/src/main/java/thaumic/tinkerer/client/render/block/kami/RenderWarpGate.java +++ b/src/main/java/thaumic/tinkerer/client/render/block/kami/RenderWarpGate.java @@ -1,29 +1,28 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 4:03:03 PM (GMT)] */ package thaumic.tinkerer.client.render.block.kami; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.block.BlockRenderer; import thaumic.tinkerer.client.lib.LibRenderIDs; import thaumic.tinkerer.common.block.kami.BlockWarpGate; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderingHandler { @@ -47,8 +46,8 @@ public class RenderWarpGate extends BlockRenderer implements ISimpleBlockRenderi } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); renderer.setRenderBoundsFromBlock(block); renderer.renderStandardBlock(block, x, y, z); diff --git a/src/main/java/thaumic/tinkerer/client/render/item/RenderGenericSeeds.java b/src/main/java/thaumic/tinkerer/client/render/item/RenderGenericSeeds.java index f18675ea..cfe2dc57 100644 --- a/src/main/java/thaumic/tinkerer/client/render/item/RenderGenericSeeds.java +++ b/src/main/java/thaumic/tinkerer/client/render/item/RenderGenericSeeds.java @@ -8,7 +8,9 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumic.tinkerer.common.item.ItemInfusedSeeds; @@ -126,10 +128,10 @@ public class RenderGenericSeeds implements IItemRenderer { private void setColorForAspect(Aspect aspect) { // if(!aspect.isPrimal()){ - // float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F; - // float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F; - // float b = (aspect.getColor() & 0xFF) / 255.0F; - // GL11.glColor3f(r, g, b); + // float r = (aspect.getColor() >> 16 & 0xFF) / 255.0F; + // float g = (aspect.getColor() >> 8 & 0xFF) / 255.0F; + // float b = (aspect.getColor() & 0xFF) / 255.0F; + // GL11.glColor3f(r, g, b); // } } } diff --git a/src/main/java/thaumic/tinkerer/client/render/item/RenderMobDisplay.java b/src/main/java/thaumic/tinkerer/client/render/item/RenderMobDisplay.java index 158d1bb4..be50dcb2 100644 --- a/src/main/java/thaumic/tinkerer/client/render/item/RenderMobDisplay.java +++ b/src/main/java/thaumic/tinkerer/client/render/item/RenderMobDisplay.java @@ -8,7 +8,9 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.common.core.helper.EnumMobAspect; import thaumic.tinkerer.common.item.ItemMobDisplay; @@ -22,8 +24,8 @@ public class RenderMobDisplay implements IItemRenderer { } @Override - public boolean shouldUseRenderHelper( - ItemRenderType itemRenderType, ItemStack itemStack, ItemRendererHelper itemRendererHelper) { + public boolean shouldUseRenderHelper(ItemRenderType itemRenderType, ItemStack itemStack, + ItemRendererHelper itemRendererHelper) { return true; } diff --git a/src/main/java/thaumic/tinkerer/client/render/item/kami/RenderPlacementMirror.java b/src/main/java/thaumic/tinkerer/client/render/item/kami/RenderPlacementMirror.java index d05c1d95..2a4e0ed8 100644 --- a/src/main/java/thaumic/tinkerer/client/render/item/kami/RenderPlacementMirror.java +++ b/src/main/java/thaumic/tinkerer/client/render/item/kami/RenderPlacementMirror.java @@ -7,7 +7,9 @@ import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.item.kami.ItemPlacementMirror; @@ -40,8 +42,7 @@ public class RenderPlacementMirror implements IItemRenderer { } case EQUIPPED: { for (int i = 1; i >= 0; i--) { - IIcon icon = ThaumicTinkerer.registry - .getFirstItemFromClass(ItemPlacementMirror.class) + IIcon icon = ThaumicTinkerer.registry.getFirstItemFromClass(ItemPlacementMirror.class) .getIconFromDamageForRenderPass(0, i); if (i == 0) { GL11.glEnable(GL11.GL_BLEND); @@ -53,7 +54,14 @@ public class RenderPlacementMirror implements IItemRenderer { float f2 = icon.getMinV(); float f3 = icon.getMaxV(); ItemRenderer.renderItemIn2D( - Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + Tessellator.instance, + f1, + f2, + f, + f3, + icon.getIconWidth(), + icon.getIconHeight(), + 1F / 16F); } GL11.glDisable(GL11.GL_BLEND); break; diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileAnimationTablet.java b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileAnimationTablet.java index a6a98143..e85a2b29 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileAnimationTablet.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileAnimationTablet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 17:12:26 (GMT)] @@ -24,7 +21,9 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet; @@ -36,12 +35,8 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer { private static final ResourceLocation overlayRight = new ResourceLocation(LibResources.MISC_AT_RIGHT); private static final ResourceLocation overlayIndent = new ResourceLocation(LibResources.MISC_AT_INDENT); - private static final float[][] TRANSLATIONS = new float[][] { - {0F, 0F, -1F}, - {-1F, 0F, 0F}, - {0F, 0F, 0F}, - {-1F, 0F, -1F} - }; + private static final float[][] TRANSLATIONS = new float[][] { { 0F, 0F, -1F }, { -1F, 0F, 0F }, { 0F, 0F, 0F }, + { -1F, 0F, -1F } }; @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float partialTicks) { @@ -90,15 +85,8 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer { } } - private void renderOverlay( - TileAnimationTablet tablet, - ResourceLocation texture, - int rotationMod, - boolean useLighting, - boolean useBlend, - double size, - float height, - float forceDeg) { + private void renderOverlay(TileAnimationTablet tablet, ResourceLocation texture, int rotationMod, + boolean useLighting, boolean useBlend, double size, float height, float forceDeg) { Minecraft mc = ClientHelper.minecraft(); mc.renderEngine.bindTexture(texture); GL11.glPushMatrix(); diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileEnchanter.java b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileEnchanter.java index 4606eaf5..040c926e 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileEnchanter.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileEnchanter.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [16 Sep 2013, 22:39:36 (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.client.render.tile; import java.awt.*; + import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; @@ -23,7 +21,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer.ItemRenderType; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.item.ItemWandRenderer; import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.common.block.tile.TileEnchanter; @@ -61,7 +61,14 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer { float f2 = icon.getMinV(); float f3 = icon.getMaxV(); ItemRenderer.renderItemIn2D( - Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + Tessellator.instance, + f1, + f2, + f, + f3, + icon.getIconWidth(), + icon.getIconHeight(), + 1F / 16F); GL11.glColor3f(1F, 1F, 1F); } renderPass++; diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileFunnel.java b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileFunnel.java index be70e453..5c7b2955 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileFunnel.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileFunnel.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [28 Sep 2013, 20:24:39 (GMT)] @@ -18,7 +15,9 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.block.BlockJarRenderer; import thaumcraft.client.renderers.tile.ItemJarFilledRenderer; import thaumic.tinkerer.common.block.tile.TileFunnel; @@ -36,8 +35,8 @@ public class RenderTileFunnel extends TileEntitySpecialRenderer { GL11.glPushMatrix(); GL11.glTranslated(d0 + 0.5, d1 + 0.365, d2 + 0.5); // if(Block.getBlockFromItem(stack.getItem())== ConfigBlocks.blockJar) { - // GL11.glTranslatef(0F, 0.25F, 0F); - // jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, 0, 0, new RenderBlocks()); + // GL11.glTranslatef(0F, 0.25F, 0F); + // jarRenderer.renderInventoryBlock(ConfigBlocks.blockJar, 0, 0, new RenderBlocks()); // } // else jarRenderer1.renderItem(IItemRenderer.ItemRenderType.ENTITY, stack, (Object[]) null); diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileMagnet.java b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileMagnet.java index cacd6bc8..d13bb734 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileMagnet.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileMagnet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:55:04 (GMT)] @@ -19,8 +16,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; + import thaumcraft.client.lib.UtilsFX; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.items.armor.ItemHoverHarness; @@ -44,25 +43,21 @@ public class RenderTileMagnet extends TileEntitySpecialRenderer { GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glTranslatef((float) x, (float) y, (float) z); boolean blue = tileentity.getWorldObj() == null || (tileentity.getBlockMetadata() & 1) == 0; - boolean mob = - tileentity.getWorldObj() == null ? RenderTileMagnet.mob : (tileentity.getBlockMetadata() & 2) == 2; + boolean mob = tileentity.getWorldObj() == null ? RenderTileMagnet.mob + : (tileentity.getBlockMetadata() & 2) == 2; - ClientHelper.minecraft() - .renderEngine + ClientHelper.minecraft().renderEngine .bindTexture(mob ? blue ? blueMob : redMob : blue ? RenderTileMagnet.blue : red); int redstone = 0; if (tileentity.getWorldObj() != null) { - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - redstone = Math.max( - redstone, - tileentity - .getWorldObj() - .getIndirectPowerLevelTo( - tileentity.xCoord + dir.offsetX, - tileentity.yCoord + dir.offsetY, - tileentity.zCoord + dir.offsetZ, - dir.ordinal())); + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) redstone = Math.max( + redstone, + tileentity.getWorldObj().getIndirectPowerLevelTo( + tileentity.xCoord + dir.offsetX, + tileentity.yCoord + dir.offsetY, + tileentity.zCoord + dir.offsetZ, + dir.ordinal())); } else redstone = 15; GL11.glTranslatef(0.5F, 1.5F, 0.5F); diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRelay.java b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRelay.java index 59ee2137..47086543 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRelay.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRelay.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:55:04 (GMT)] @@ -17,8 +14,10 @@ package thaumic.tinkerer.client.render.tile; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; + import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.client.model.ModelRelay; diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRepairer.java b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRepairer.java index ee82b984..78e468cb 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRepairer.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/RenderTileRepairer.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 30, 2013, 5:27:39 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.client.render.tile; import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; @@ -24,8 +22,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; + import thaumic.tinkerer.client.core.helper.ClientHelper; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.client.model.ModelRepairer; @@ -85,7 +85,14 @@ public class RenderTileRepairer extends TileEntitySpecialRenderer { float f2 = icon.getMinV(); float f3 = icon.getMaxV(); ItemRenderer.renderItemIn2D( - Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F); + Tessellator.instance, + f1, + f2, + f, + f3, + icon.getIconWidth(), + icon.getIconHeight(), + 1F / 16F); GL11.glColor3f(1F, 1F, 1F); } renderPass++; diff --git a/src/main/java/thaumic/tinkerer/client/render/tile/kami/RenderTileWarpGate.java b/src/main/java/thaumic/tinkerer/client/render/tile/kami/RenderTileWarpGate.java index acd5a968..e025fb52 100644 --- a/src/main/java/thaumic/tinkerer/client/render/tile/kami/RenderTileWarpGate.java +++ b/src/main/java/thaumic/tinkerer/client/render/tile/kami/RenderTileWarpGate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 4:44:15 PM (GMT)] @@ -16,7 +13,9 @@ package thaumic.tinkerer.client.render.tile.kami; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; + import org.lwjgl.opengl.GL11; + import thaumic.tinkerer.client.model.kami.ModelSpinningCubes; public class RenderTileWarpGate extends TileEntitySpecialRenderer { diff --git a/src/main/java/thaumic/tinkerer/common/ThaumicTinkerer.java b/src/main/java/thaumic/tinkerer/common/ThaumicTinkerer.java index a0b595b4..16a11008 100644 --- a/src/main/java/thaumic/tinkerer/common/ThaumicTinkerer.java +++ b/src/main/java/thaumic/tinkerer/common/ThaumicTinkerer.java @@ -1,34 +1,25 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:01:28 (GMT)] */ package thaumic.tinkerer.common; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import java.util.Arrays; + import net.minecraft.command.ICommandManager; import net.minecraft.command.ServerCommandManager; import net.minecraft.server.MinecraftServer; import net.minecraftforge.common.DimensionManager; + import org.apache.logging.log4j.Logger; + import thaumcraft.common.CommonProxy; import thaumcraft.common.Thaumcraft; import thaumic.tinkerer.api.InterModCommsOperations; @@ -42,6 +33,15 @@ import thaumic.tinkerer.common.lib.LibMisc; import thaumic.tinkerer.common.peripheral.PeripheralHandler; import thaumic.tinkerer.common.registry.TTRegistry; import thaumic.tinkerer.common.research.KamiResearchItem; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.*; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; @Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION, dependencies = LibMisc.DEPENDENCIES) public class ThaumicTinkerer { @@ -66,7 +66,9 @@ public class ThaumicTinkerer { proxy.preInit(event); if (Loader.isModLoaded("Waila")) { FMLInterModComms.sendMessage( - "Waila", "register", "thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister"); + "Waila", + "register", + "thaumic.tinkerer.common.compat.TTinkererProvider.callbackRegister"); } } diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockAnimationTablet.java b/src/main/java/thaumic/tinkerer/common/block/BlockAnimationTablet.java index e6e10060..5ed46146 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockAnimationTablet.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockAnimationTablet.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 15:52:53 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -34,6 +30,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -50,6 +47,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockAnimationTablet extends BlockModContainer { @@ -78,8 +77,8 @@ public class BlockAnimationTablet extends BlockModContainer { } @Override - public void onBlockPlacedBy( - World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) { + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, + ItemStack par6ItemStack) { byte b0 = 0; int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; @@ -93,8 +92,8 @@ public class BlockAnimationTablet extends BlockModContainer { par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); // TileAnimationTablet tablet = (TileAnimationTablet) par1World.getTileEntity(par2, par3, par4); - // if(par5EntityLiving instanceof EntityPlayer) { - // tablet.Owner = ((EntityPlayer) par5EntityLiving).username; + // if(par5EntityLiving instanceof EntityPlayer) { + // tablet.Owner = ((EntityPlayer) par5EntityLiving).username; // } } @@ -117,9 +116,8 @@ public class BlockAnimationTablet extends BlockModContainer { float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -136,9 +134,8 @@ public class BlockAnimationTablet extends BlockModContainer { entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -190,16 +187,8 @@ public class BlockAnimationTablet extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { if (!par1World.isRemote) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); if (tile != null) { @@ -211,17 +200,16 @@ public class BlockAnimationTablet extends BlockModContainer { if (!activated && !tablet.getIsBreaking() && tablet.swingProgress == 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, meta == 5 ? 2 : meta + 1, 1 | 2); par1World.playSoundEffect(par2, par3, par4, "thaumcraft:tool", 0.6F, 1F); - } else - par5EntityPlayer.addChatMessage( - new ChatComponentTranslation("ttmisc.animationTablet.notRotatable")); + } else par5EntityPlayer + .addChatMessage(new ChatComponentTranslation("ttmisc.animationTablet.notRotatable")); // Rare chance this might happen, but better to cope for it. return true; } else { // if(tablet.Owner==null || tablet.Owner.equals("")) - // tablet.Owner=par5EntityPlayer.username; - par5EntityPlayer.openGui( - ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4); + // tablet.Owner=par5EntityPlayer.username; + par5EntityPlayer + .openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_TABLET, par1World, par2, par3, par4); } } } @@ -232,8 +220,7 @@ public class BlockAnimationTablet extends BlockModContainer { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int par2) { - return par1 == ForgeDirection.UP.ordinal() - ? iconTop + return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides; } @@ -285,19 +272,16 @@ public class BlockAnimationTablet extends BlockModContainer { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_ANIMATION_TABLET, - new AspectList() - .add(Aspect.MECHANISM, 2) - .add(Aspect.METAL, 1) - .add(Aspect.MOTION, 1) - .add(Aspect.ENERGY, 1), - -8, - 2, - 4, - new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class))) - .setWarp(1) - .setParents(LibResearch.KEY_MAGNETS) - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET)); + LibResearch.KEY_ANIMATION_TABLET, + new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.METAL, 1).add(Aspect.MOTION, 1) + .add(Aspect.ENERGY, 1), + -8, + 2, + 4, + new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class))).setWarp(1) + .setParents(LibResearch.KEY_MAGNETS).setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_ANIMATION_TABLET)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockAspectAnalyzer.java b/src/main/java/thaumic/tinkerer/common/block/BlockAspectAnalyzer.java index 1346300f..398d27b3 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockAspectAnalyzer.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockAspectAnalyzer.java @@ -1,22 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 10:31:09 PM (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.common.Loader; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -28,6 +25,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -44,6 +42,7 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.common.Loader; public class BlockAspectAnalyzer extends BlockModContainer { @@ -60,21 +59,18 @@ public class BlockAspectAnalyzer extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { if (!par1World.isRemote) { TileAspectAnalyzer tile = (TileAspectAnalyzer) par1World.getTileEntity(par2, par3, par4); if (tile != null) { par5EntityPlayer.openGui( - ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ASPECT_ANALYZER, par1World, par2, par3, par4); + ThaumicTinkerer.instance, + LibGuiIDs.GUI_ID_ASPECT_ANALYZER, + par1World, + par2, + par3, + par4); } } @@ -94,9 +90,8 @@ public class BlockAspectAnalyzer extends BlockModContainer { float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -113,9 +108,8 @@ public class BlockAspectAnalyzer extends BlockModContainer { entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -174,20 +168,15 @@ public class BlockAspectAnalyzer extends BlockModContainer { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_ASPECT_ANALYZER, - new AspectList() - .add(Aspect.MECHANISM, 2) - .add(Aspect.SENSES, 1) - .add(Aspect.MIND, 1), - 0, - 1, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_PERIPHERALS) - .setParentsHidden("GOGGLES", "THAUMIUM") - .setConcealed() - .setRound() - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ASPECT_ANALYZER)); + LibResearch.KEY_ASPECT_ANALYZER, + new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.SENSES, 1).add(Aspect.MIND, 1), + 0, + 1, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOGGLES", "THAUMIUM") + .setConcealed().setRound().setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_ASPECT_ANALYZER)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockCamo.java b/src/main/java/thaumic/tinkerer/common/block/BlockCamo.java index 19318c26..67c85bb9 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockCamo.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockCamo.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 6:25:36 PM (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockDirectional; import net.minecraft.block.material.Material; @@ -30,7 +26,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumic.tinkerer.common.block.tile.TileCamo; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class BlockCamo extends BlockModContainer { @@ -59,16 +58,8 @@ public abstract class BlockCamo extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); if (tile instanceof TileCamo) { @@ -77,8 +68,7 @@ public abstract class BlockCamo extends BlockModContainer { boolean doChange = true; Block block = null; - checkChange: - { + checkChange: { if (currentStack != null) { if (Item.getIdFromItem(currentStack.getItem()) == 0) { doChange = false; @@ -86,10 +76,10 @@ public abstract class BlockCamo extends BlockModContainer { } block = Block.getBlockFromItem(currentStack.getItem()); - if (block == null - || !isValidRenderType(block.getRenderType()) + if (block == null || !isValidRenderType(block.getRenderType()) || block instanceof BlockCamo - || block.getMaterial() == Material.air) doChange = false; + || block.getMaterial() == Material.air) + doChange = false; } } diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockEnchanter.java b/src/main/java/thaumic/tinkerer/common/block/BlockEnchanter.java index a8a7e6e7..58408676 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockEnchanter.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockEnchanter.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 01:13:25 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -31,6 +27,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -48,6 +45,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockEnchanter extends BlockModContainer { @@ -67,22 +66,14 @@ public class BlockEnchanter extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { if (!par1World.isRemote) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); if (tile != null) { par1World.markBlockForUpdate(par2, par3, par4); - par5EntityPlayer.openGui( - ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ENCHANTER, par1World, par2, par3, par4); + par5EntityPlayer + .openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_ENCHANTER, par1World, par2, par3, par4); } } @@ -102,9 +93,8 @@ public class BlockEnchanter extends BlockModContainer { float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -121,9 +111,8 @@ public class BlockEnchanter extends BlockModContainer { entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -145,8 +134,7 @@ public class BlockEnchanter extends BlockModContainer { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int par2) { - return par1 == ForgeDirection.UP.ordinal() - ? iconTop + return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSides; } @@ -198,19 +186,13 @@ public class BlockEnchanter extends BlockModContainer { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_ENCHANTER, - new AspectList() - .add(Aspect.MAGIC, 2) - .add(Aspect.AURA, 1) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.DARKNESS, 1) - .add(Aspect.MIND, 1), - 5, - 4, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_SPELL_CLOTH) - .setPages( + LibResearch.KEY_ENCHANTER, + new AspectList().add(Aspect.MAGIC, 2).add(Aspect.AURA, 1).add(Aspect.ELDRITCH, 1) + .add(Aspect.DARKNESS, 1).add(Aspect.MIND, 1), + 5, + 4, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_SPELL_CLOTH).setPages( new ResearchPage("0"), new ResearchPage("1"), new ResearchPage("2"), @@ -223,12 +205,8 @@ public class BlockEnchanter extends BlockModContainer { LibResearch.KEY_ENCHANTER, new ItemStack(this), 15, - new AspectList() - .add(Aspect.MAGIC, 50) - .add(Aspect.ENERGY, 20) - .add(Aspect.ELDRITCH, 20) - .add(Aspect.VOID, 20) - .add(Aspect.MIND, 10), + new AspectList().add(Aspect.MAGIC, 50).add(Aspect.ENERGY, 20).add(Aspect.ELDRITCH, 20) + .add(Aspect.VOID, 20).add(Aspect.MIND, 10), new ItemStack(Blocks.enchanting_table), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 1), diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockForcefield.java b/src/main/java/thaumic/tinkerer/common/block/BlockForcefield.java index fdb7f055..80ce84ee 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockForcefield.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockForcefield.java @@ -1,10 +1,12 @@ package thaumic.tinkerer.common.block; import java.util.ArrayList; + import net.minecraft.block.material.Material; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumic.tinkerer.common.block.tile.TileForcefield; import thaumic.tinkerer.common.lib.LibBlockNames; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; @@ -14,6 +16,7 @@ import thaumic.tinkerer.common.research.IRegisterableResearch; * Created by pixlepix on 4/19/14. */ public class BlockForcefield extends BlockMod { + public BlockForcefield() { super(Material.air); } diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockFunnel.java b/src/main/java/thaumic/tinkerer/common/block/BlockFunnel.java index b09294fc..df3a503e 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockFunnel.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockFunnel.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [28 Sep 2013, 19:33:05 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -32,6 +28,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -45,6 +42,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockFunnel extends BlockModContainer { @@ -117,9 +116,8 @@ public class BlockFunnel extends BlockModContainer { float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -136,9 +134,8 @@ public class BlockFunnel extends BlockModContainer { entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -150,16 +147,8 @@ public class BlockFunnel extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { TileFunnel funnel = (TileFunnel) par1World.getTileEntity(par2, par3, par4); ItemStack stack = funnel.getStackInSlot(0); @@ -223,17 +212,15 @@ public class BlockFunnel extends BlockModContainer { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_FUNNEL, - new AspectList().add(Aspect.TOOL, 1).add(Aspect.TRAVEL, 2), - 0, - -7, - 1, - new ItemStack(this)) - .setParentsHidden("DISTILESSENTIA") - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FUNNEL)) - .setSecondary(); + LibResearch.KEY_FUNNEL, + new AspectList().add(Aspect.TOOL, 1).add(Aspect.TRAVEL, 2), + 0, + -7, + 1, + new ItemStack(this)).setParentsHidden("DISTILESSENTIA").setParents(LibResearch.KEY_BRIGHT_NITOR) + .setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FUNNEL)) + .setSecondary(); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockGas.java b/src/main/java/thaumic/tinkerer/common/block/BlockGas.java index 96a6e50d..5d3857f0 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockGas.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockGas.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 22:13:36 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; @@ -28,10 +24,13 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.Explosion; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.registry.ITTinkererBlock; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class BlockGas extends BlockMod implements ITTinkererBlock { diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockGaseousLight.java b/src/main/java/thaumic/tinkerer/common/block/BlockGaseousLight.java index 4f8a1d3f..09038464 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockGaseousLight.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockGaseousLight.java @@ -1,27 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 22:20:30 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Random; + import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.lib.LibBlockNames; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockGaseousLight extends BlockGas { diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockGaseousShadow.java b/src/main/java/thaumic/tinkerer/common/block/BlockGaseousShadow.java index 6b816253..edf693a2 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockGaseousShadow.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockGaseousShadow.java @@ -1,27 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 22:21:13 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Random; + import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.lib.LibBlockNames; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockGaseousShadow extends BlockGas { @@ -33,9 +32,8 @@ public class BlockGaseousShadow extends BlockGas { @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par5Random.nextFloat() < 0.0075F) - ThaumicTinkerer.tcProxy.wispFX2( - par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, 0.125F, 5, true, true, -0.02F); + if (par5Random.nextFloat() < 0.0075F) ThaumicTinkerer.tcProxy + .wispFX2(par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, 0.125F, 5, true, true, -0.02F); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockGolemConnector.java b/src/main/java/thaumic/tinkerer/common/block/BlockGolemConnector.java index e229c97e..c9a3883f 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockGolemConnector.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockGolemConnector.java @@ -1,7 +1,7 @@ package thaumic.tinkerer.common.block; -import cpw.mods.fml.common.Loader; import java.util.ArrayList; + import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -9,6 +9,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -23,6 +24,7 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.common.Loader; public class BlockGolemConnector extends BlockCamo { @@ -79,26 +81,19 @@ public class BlockGolemConnector extends BlockCamo { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_GOLEMCONNECTOR, - new AspectList() - .add(Aspect.ORDER, 1) - .add(Aspect.TRAVEL, 2) - .add(Aspect.TOOL, 1), - 1, - 0, - 0, - new ItemStack(this)) - .setParents(LibResearch.KEY_PERIPHERALS) - .setParentsHidden("GOLEMBELL") - .setConcealed() - .setRound() - .setPages( - new ResearchPage("0"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_GOLEMCONNECTOR), - new ResearchPage("1"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"), - new ResearchPage("2"), - new ResearchPage("3")); + LibResearch.KEY_GOLEMCONNECTOR, + new AspectList().add(Aspect.ORDER, 1).add(Aspect.TRAVEL, 2).add(Aspect.TOOL, 1), + 1, + 0, + 0, + new ItemStack(this)).setParents(LibResearch.KEY_PERIPHERALS).setParentsHidden("GOLEMBELL") + .setConcealed().setRound().setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_GOLEMCONNECTOR), + new ResearchPage("1"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"), + new ResearchPage("2"), + new ResearchPage("3")); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockInfusedFarmland.java b/src/main/java/thaumic/tinkerer/common/block/BlockInfusedFarmland.java index 0b9e381a..63294d42 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockInfusedFarmland.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockInfusedFarmland.java @@ -1,9 +1,8 @@ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.BlockFarmland; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; @@ -15,12 +14,15 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.block.tile.TileInfusedFarmland; import thaumic.tinkerer.common.lib.LibBlockNames; import thaumic.tinkerer.common.registry.ITTinkererBlock; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** * Created by pixlepix on 8/4/14. @@ -82,8 +84,8 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo } @Override - public boolean canSustainPlant( - IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) { + public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, + IPlantable plantable) { return plantable instanceof BlockInfusedGrain; } @@ -105,12 +107,7 @@ public class BlockInfusedFarmland extends BlockFarmland implements ITTinkererBlo // Prevent farmland degrading @Override - public void onFallenUpon( - World p_149746_1_, - int p_149746_2_, - int p_149746_3_, - int p_149746_4_, - Entity p_149746_5_, + public void onFallenUpon(World p_149746_1_, int p_149746_2_, int p_149746_3_, int p_149746_4_, Entity p_149746_5_, float p_149746_6_) {} @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockInfusedGrain.java b/src/main/java/thaumic/tinkerer/common/block/BlockInfusedGrain.java index 1578f111..22a2d0db 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockInfusedGrain.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockInfusedGrain.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.block; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockCrops; import net.minecraft.client.renderer.texture.IIconRegister; @@ -11,6 +12,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.lib.research.ResearchManager; @@ -103,7 +105,7 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock { @Override public void registerBlockIcons(IIconRegister par1IconRegister) { icons = new IIcon[7][4]; - String[] names = {"aer", "ignis", "aqua", "terra", "ordo", "perditio", "generic"}; + String[] names = { "aer", "ignis", "aqua", "terra", "ordo", "perditio", "generic" }; for (int j = 0; j < names.length; j++) { String s = names[j]; for (int i = 0; i < 4; i++) { @@ -184,10 +186,9 @@ public class BlockInfusedGrain extends BlockCrops implements ITTinkererBlock { AspectList farmlandAspectList = ((TileInfusedFarmland) world.getTileEntity(x, y - 1, z)).aspectList; for (Aspect aspect : farmlandAspectList.getAspects()) { Random rand = new Random(); - if (rand.nextInt(BREEDING_CHANCE) - < (getPrimalTendencyCount(world, x, y, z, Aspect.FIRE) + 1) - * farmlandAspectList.getAmount(aspect) - * farmlandAspectList.getAmount(aspect)) { + if (rand.nextInt(BREEDING_CHANCE) < (getPrimalTendencyCount(world, x, y, z, Aspect.FIRE) + 1) + * farmlandAspectList.getAmount(aspect) + * farmlandAspectList.getAmount(aspect)) { if (ResearchManager.getCombinationResult(aspect, currentAspect) != null) { return ResearchManager.getCombinationResult(aspect, currentAspect); } diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockMagnet.java b/src/main/java/thaumic/tinkerer/common/block/BlockMagnet.java index 6046304d..12e46cdd 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockMagnet.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockMagnet.java @@ -1,25 +1,21 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:01:27 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; @@ -33,6 +29,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -56,6 +53,8 @@ import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.RecipeHelper; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBlock { @@ -72,22 +71,19 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { if (par5EntityPlayer.getCurrentEquippedItem() != null) { if (par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); if (tile != null && tile instanceof TileMobMagnet) { par5EntityPlayer.openGui( - ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_MOB_MAGNET, par1World, par2, par3, par4); + ThaumicTinkerer.instance, + LibGuiIDs.GUI_ID_MOB_MAGNET, + par1World, + par2, + par3, + par4); if (!par1World.isRemote) { par1World.playSoundEffect(par2, par3, par4, "thaumcraft:key", 1F, 0.5F); } @@ -118,9 +114,8 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -137,9 +132,8 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -230,24 +224,18 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_MAGNETS, - new AspectList() - .add(Aspect.MECHANISM, 2) - .add(Aspect.MOTION, 1) - .add(Aspect.SENSES, 1), - -6, - 3, - 3, - new ItemStack(this)) - .setParents(LibResearch.KEY_INTERFACE) - .setParentsHidden(LibResearch.KEY_FOCUS_TELEKINESIS) - .setConcealed() - .setPages( - new ResearchPage("0"), - new ResearchPage("1"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_MAGNET), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_MOB_MAGNET), - ResearchHelper.crucibleRecipePage(LibResearch.KEY_MAGNETS)); + LibResearch.KEY_MAGNETS, + new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1), + -6, + 3, + 3, + new ItemStack(this)).setParents(LibResearch.KEY_INTERFACE) + .setParentsHidden(LibResearch.KEY_FOCUS_TELEKINESIS).setConcealed().setPages( + new ResearchPage("0"), + new ResearchPage("1"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_MAGNET), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_MOB_MAGNET), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_MAGNETS)); } @Override @@ -258,10 +246,7 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl LibResearch.KEY_MAGNET, LibResearch.KEY_MAGNETS, new ItemStack(this), - new AspectList() - .add(Aspect.AIR, 20) - .add(Aspect.ORDER, 5) - .add(Aspect.EARTH, 15) + new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15) .add(Aspect.ENTROPY, 5), " I ", "SIs", @@ -280,10 +265,7 @@ public class BlockMagnet extends BlockModContainer implements IMultiTileEntityBl LibResearch.KEY_MOB_MAGNET, LibResearch.KEY_MAGNETS, new ItemStack(this, 1, 1), - new AspectList() - .add(Aspect.AIR, 20) - .add(Aspect.ORDER, 5) - .add(Aspect.EARTH, 15) + new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15) .add(Aspect.ENTROPY, 5), " G ", "SGs", diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockMod.java b/src/main/java/thaumic/tinkerer/common/block/BlockMod.java index 1d9f99c8..5792f77c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockMod.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockMod.java @@ -1,30 +1,29 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 15:57:04 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.core.handler.ModCreativeTab; import thaumic.tinkerer.common.registry.ITTinkererBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class BlockMod extends Block implements ITTinkererBlock { diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockModContainer.java b/src/main/java/thaumic/tinkerer/common/block/BlockModContainer.java index 924c1718..ac1ae3fd 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockModContainer.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockModContainer.java @@ -1,30 +1,28 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 18:57:45 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.core.handler.ModCreativeTab; import thaumic.tinkerer.common.registry.ITTinkererBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class BlockModContainer extends BlockContainer implements ITTinkererBlock { diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockNitorGas.java b/src/main/java/thaumic/tinkerer/common/block/BlockNitorGas.java index 654af1ed..1a9e6204 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockNitorGas.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockNitorGas.java @@ -1,34 +1,33 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [11 Sep 2013, 17:47:28 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.item.ItemBrightNitor; import thaumic.tinkerer.common.item.kami.armor.ItemGemLegs; import thaumic.tinkerer.common.lib.LibBlockNames; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockNitorGas extends BlockGas { @@ -56,7 +55,12 @@ public class BlockNitorGas extends BlockGas { List players = par1World.getEntitiesWithinAABB( EntityPlayer.class, AxisAlignedBB.getBoundingBox( - par2 - dist, par3 - dist, par4 - dist, par2 + dist, par3 + dist, par4 + dist)); + par2 - dist, + par3 - dist, + par4 - dist, + par2 + dist, + par3 + dist, + par4 + dist)); if (players.isEmpty()) { par1World.setBlockToAir(par2, par3, par4); remove = true; @@ -64,13 +68,12 @@ public class BlockNitorGas extends BlockGas { boolean has = false; for (EntityPlayer player : players) if (player.inventory.hasItem(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)) - || (ConfigHandler.enableKami - && player.getCurrentArmor(1) != null + || (ConfigHandler.enableKami && player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemLegs.class))) { - has = true; - break; - } + has = true; + break; + } if (!has) { par1World.setBlockToAir(par2, par3, par4); diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockPlatform.java b/src/main/java/thaumic/tinkerer/common/block/BlockPlatform.java index 90bd971f..e55340b3 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockPlatform.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockPlatform.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 6:36:19 PM (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.block; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -26,6 +24,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -49,16 +48,9 @@ public class BlockPlatform extends BlockCamo { } @Override - public void addCollisionBoxesToList( - World par1World, - int par2, - int par3, - int par4, - AxisAlignedBB par5AxisAlignedBB, - List par6List, - Entity par7Entity) { - if (par7Entity != null - && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0) + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, + List par6List, Entity par7Entity) { + if (par7Entity != null && par7Entity.posY > par3 + (par7Entity instanceof EntityPlayer ? 2 : 0) && (!(par7Entity instanceof EntityPlayer) || !par7Entity.isSneaking())) super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); } @@ -106,19 +98,14 @@ public class BlockPlatform extends BlockCamo { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_PLATFORM, - new AspectList() - .add(Aspect.SENSES, 2) - .add(Aspect.TREE, 1) - .add(Aspect.MOTION, 1), - -2, - 6, - 3, - new ItemStack(this)) - .setConcealed() - .setParents(LibResearch.KEY_CLEANSING_TALISMAN) - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM)) - .setSecondary(); + LibResearch.KEY_PLATFORM, + new AspectList().add(Aspect.SENSES, 2).add(Aspect.TREE, 1).add(Aspect.MOTION, 1), + -2, + 6, + 3, + new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_CLEANSING_TALISMAN) + .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_PLATFORM)) + .setSecondary(); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockRPlacer.java b/src/main/java/thaumic/tinkerer/common/block/BlockRPlacer.java index d69a42bf..2ba0e601 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockRPlacer.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockRPlacer.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.block; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; import net.minecraft.block.material.Material; @@ -15,6 +16,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -38,6 +40,7 @@ import thaumic.tinkerer.common.research.TTResearchItem; * Created by nekosune on 28/06/14. */ public class BlockRPlacer extends BlockCamo implements IWandable { + IIcon[] icons = new IIcon[2]; public BlockRPlacer() { @@ -45,16 +48,8 @@ public class BlockRPlacer extends BlockCamo implements IWandable { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); TileRPlacer dislocator = (TileRPlacer) tile; @@ -111,18 +106,12 @@ public class BlockRPlacer extends BlockCamo implements IWandable { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_REMOTE_PLACER, - new AspectList() - .add(Aspect.MECHANISM, 2) - .add(Aspect.MOTION, 1) - .add(Aspect.SENSES, 1), - -6, - 3, - 3, - new ItemStack(this)) - .setParents(LibResearch.KEY_ANIMATION_TABLET) - .setConcealed() - .setPages( + LibResearch.KEY_REMOTE_PLACER, + new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1).add(Aspect.SENSES, 1), + -6, + 3, + 3, + new ItemStack(this)).setParents(LibResearch.KEY_ANIMATION_TABLET).setConcealed().setPages( new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_REMOTE_PLACER)); @@ -134,11 +123,7 @@ public class BlockRPlacer extends BlockCamo implements IWandable { LibResearch.KEY_REMOTE_PLACER, LibResearch.KEY_REMOTE_PLACER, new ItemStack(this), - new AspectList() - .add(Aspect.AIR, 20) - .add(Aspect.ORDER, 5) - .add(Aspect.EARTH, 15) - .add(Aspect.ENTROPY, 5), + new AspectList().add(Aspect.AIR, 20).add(Aspect.ORDER, 5).add(Aspect.EARTH, 15).add(Aspect.ENTROPY, 5), "ses", "sds", "sss", @@ -161,22 +146,17 @@ public class BlockRPlacer extends BlockCamo implements IWandable { } @Override - public void onBlockPlacedBy( - World par1World, - int par2, - int par3, - int par4, - EntityLivingBase par5EntityLivingBase, + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); - ((TileRPlacer) tile).orientation = - BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); + ((TileRPlacer) tile).orientation = BlockPistonBase + .determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); par1World.markBlockForUpdate(par2, par3, par4); } @Override - public int onWandRightClick( - World world, ItemStack itemStack, EntityPlayer entityPlayer, int i, int i2, int i3, int i4, int i5) { + public int onWandRightClick(World world, ItemStack itemStack, EntityPlayer entityPlayer, int i, int i2, int i3, + int i4, int i5) { if (!world.isRemote) { if (entityPlayer.isSneaking()) { entityPlayer.openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_REMOTE_PLACER, world, i, i2, i3); diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockRepairer.java b/src/main/java/thaumic/tinkerer/common/block/BlockRepairer.java index 3d1deca8..766abd8a 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockRepairer.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockRepairer.java @@ -1,24 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 30, 2013, 5:36:26 PM (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -34,6 +29,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -49,6 +45,9 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockRepairer extends BlockModContainer { @@ -63,16 +62,8 @@ public class BlockRepairer extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { TileRepairer repairer = (TileRepairer) par1World.getTileEntity(par2, par3, par4); ItemStack stack = repairer.getStackInSlot(0); @@ -100,8 +91,8 @@ public class BlockRepairer extends BlockModContainer { } @Override - public void onBlockPlacedBy( - World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack) { + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, + ItemStack par6ItemStack) { byte b0 = 0; int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; @@ -129,9 +120,8 @@ public class BlockRepairer extends BlockModContainer { float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -144,15 +134,18 @@ public class BlockRepairer extends BlockModContainer { } else dmg = itemstack.getItemDamage(); } else dmg = itemstack.getItemDamage(); entityitem = new EntityItem( - par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, dmg)); + par1World, + par2 + f, + par3 + f1, + par4 + f2, + new ItemStack(itemstack.getItem(), k1, dmg)); float f3 = 0.05F; entityitem.motionX = (float) random.nextGaussian() * f3; entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -222,20 +215,14 @@ public class BlockRepairer extends BlockModContainer { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_REPAIRER, - new AspectList() - .add(Aspect.TOOL, 2) - .add(Aspect.CRAFT, 1) - .add(Aspect.ORDER, 1) - .add(Aspect.MAGIC, 1), - -1, - -9, - 3, - new ItemStack(this)) - .setConcealed() - .setParents(LibResearch.KEY_FUNNEL) - .setParentsHidden("THAUMIUM", "ENCHFABRIC") - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_REPAIRER)); + LibResearch.KEY_REPAIRER, + new AspectList().add(Aspect.TOOL, 2).add(Aspect.CRAFT, 1).add(Aspect.ORDER, 1).add(Aspect.MAGIC, 1), + -1, + -9, + 3, + new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_FUNNEL) + .setParentsHidden("THAUMIUM", "ENCHFABRIC") + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_REPAIRER)); } @Override @@ -244,11 +231,7 @@ public class BlockRepairer extends BlockModContainer { LibResearch.KEY_REPAIRER, new ItemStack(this), 8, - new AspectList() - .add(Aspect.TOOL, 15) - .add(Aspect.CRAFT, 20) - .add(Aspect.ORDER, 10) - .add(Aspect.MAGIC, 15), + new AspectList().add(Aspect.TOOL, 15).add(Aspect.CRAFT, 20).add(Aspect.ORDER, 10).add(Aspect.MAGIC, 15), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), new ItemStack(Items.iron_ingot), new ItemStack(Items.gold_ingot), diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockSummon.java b/src/main/java/thaumic/tinkerer/common/block/BlockSummon.java index f8a155fb..79d5bb8a 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockSummon.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockSummon.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 15:52:53 (GMT)] */ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -28,6 +24,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -43,6 +40,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockSummon extends Block implements ITTinkererBlock { @@ -91,11 +90,8 @@ public class BlockSummon extends Block implements ITTinkererBlock { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int meta) { - return par1 == ForgeDirection.UP.ordinal() - ? iconTop - : par1 == ForgeDirection.DOWN.ordinal() - ? Block.getBlockFromName("obsidian").getIcon(0, 0) - : iconSide; + return par1 == ForgeDirection.UP.ordinal() ? iconTop + : par1 == ForgeDirection.DOWN.ordinal() ? Block.getBlockFromName("obsidian").getIcon(0, 0) : iconSide; } @Override @@ -131,23 +127,18 @@ public class BlockSummon extends Block implements ITTinkererBlock { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_SUMMON, - new AspectList() - .add(Aspect.WEAPON, 1) - .add(Aspect.BEAST, 3) - .add(Aspect.MAGIC, 3), - -5, - 8, - 3, - new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class))) - .setWarp(3) - .setParents(LibResearch.KEY_BLOOD_SWORD) - .setPages( - new ResearchPage("0"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_SUMMON + "0"), - ResearchHelper.recipePage(LibResearch.KEY_SUMMON + "1"), - ResearchHelper.infusionPage(LibResearch.KEY_SUMMON), - new ResearchPage("1")); + LibResearch.KEY_SUMMON, + new AspectList().add(Aspect.WEAPON, 1).add(Aspect.BEAST, 3).add(Aspect.MAGIC, 3), + -5, + 8, + 3, + new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockSummon.class))).setWarp(3) + .setParents(LibResearch.KEY_BLOOD_SWORD).setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_SUMMON + "0"), + ResearchHelper.recipePage(LibResearch.KEY_SUMMON + "1"), + ResearchHelper.infusionPage(LibResearch.KEY_SUMMON), + new ResearchPage("1")); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockTravelSlab.java b/src/main/java/thaumic/tinkerer/common/block/BlockTravelSlab.java index 5ca6c1fb..e14cc53d 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockTravelSlab.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockTravelSlab.java @@ -1,9 +1,8 @@ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.BlockSlab; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -17,6 +16,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigBlocks; import thaumic.tinkerer.common.ThaumicTinkerer; @@ -27,6 +27,8 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock; import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** * Created by Katrina on 13/04/2015. @@ -64,7 +66,7 @@ public class BlockTravelSlab extends BlockSlab implements ITTinkererBlock { // @Override // public int idDropped(int par1, Random par2Random, int par3) { - // return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID; + // return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID; // } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockTravelStairs.java b/src/main/java/thaumic/tinkerer/common/block/BlockTravelStairs.java index 1b0cf785..5a725e77 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockTravelStairs.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockTravelStairs.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.block; import java.util.ArrayList; + import net.minecraft.block.BlockStairs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -10,6 +11,7 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigBlocks; import thaumic.tinkerer.common.core.handler.ModCreativeTab; @@ -67,14 +69,15 @@ public class BlockTravelStairs extends BlockStairs implements ITTinkererBlock { @Override public ThaumicTinkererRecipe getRecipeItem() { - return new ThaumicTinkererRecipeMulti(new ThaumicTinkererCraftingBenchRecipe( - "PAVETRAVEL", - new ItemStack(this, 4), - " Q", - " QQ", - "QQQ", - 'Q', - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2))); + return new ThaumicTinkererRecipeMulti( + new ThaumicTinkererCraftingBenchRecipe( + "PAVETRAVEL", + new ItemStack(this, 4), + " Q", + " QQ", + "QQQ", + 'Q', + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 2))); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/BlockWardSlab.java b/src/main/java/thaumic/tinkerer/common/block/BlockWardSlab.java index f6099295..47cbb58f 100644 --- a/src/main/java/thaumic/tinkerer/common/block/BlockWardSlab.java +++ b/src/main/java/thaumic/tinkerer/common/block/BlockWardSlab.java @@ -1,11 +1,10 @@ package thaumic.tinkerer.common.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; + import net.minecraft.block.BlockSlab; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -23,6 +22,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigBlocks; import thaumic.tinkerer.common.ThaumicTinkerer; @@ -34,6 +34,8 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock; import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** * Created by Katrina on 13/04/2015. @@ -72,7 +74,7 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn // @Override // public int idDropped(int par1, Random par2Random, int par3) { - // return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID; + // return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID; // } @Override @@ -164,51 +166,54 @@ public class BlockWardSlab extends BlockSlab implements ITTinkererBlock, ITileEn -0.02F); } } else if (world.getBlock(x, y + 1, z) != ConfigBlocks.blockAiry - && world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z) + && world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z) || world.getBlock(x, y + 2, z) != ConfigBlocks.blockAiry && world.getBlock(x, y + 1, z).getBlocksMovement(world, x, y + 1, z)) { - for (list = 0; list < Thaumcraft.proxy.particleCount(3); ++list) { - Thaumcraft.proxy.blockRunes( - world, - (double) x, - (double) ((float) y + 0.7F), - (double) z, - 0.9F + world.rand.nextFloat() * 0.1F, - world.rand.nextFloat() * 0.3F, - world.rand.nextFloat() * 0.3F, - 24, - -0.02F); - } - } else { - List var10 = world.getEntitiesWithinAABBExcludingEntity( - (Entity) null, - AxisAlignedBB.getBoundingBox( - (double) x, (double) y, (double) z, (double) (x + 1), (double) (y + 1), (double) - (z + 1)) - .expand(1.0D, 1.0D, 1.0D)); - if (!var10.isEmpty()) { - Iterator iterator = var10.iterator(); + for (list = 0; list < Thaumcraft.proxy.particleCount(3); ++list) { + Thaumcraft.proxy.blockRunes( + world, + (double) x, + (double) ((float) y + 0.7F), + (double) z, + 0.9F + world.rand.nextFloat() * 0.1F, + world.rand.nextFloat() * 0.3F, + world.rand.nextFloat() * 0.3F, + 24, + -0.02F); + } + } else { + List var10 = world.getEntitiesWithinAABBExcludingEntity( + (Entity) null, + AxisAlignedBB.getBoundingBox( + (double) x, + (double) y, + (double) z, + (double) (x + 1), + (double) (y + 1), + (double) (z + 1)).expand(1.0D, 1.0D, 1.0D)); + if (!var10.isEmpty()) { + Iterator iterator = var10.iterator(); - while (iterator.hasNext()) { - Entity entity = (Entity) iterator.next(); - if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer)) { - Thaumcraft.proxy.blockRunes( - world, - (double) x, - (double) ((float) y - + 0.6F - + world.rand.nextFloat() * Math.max(0.8F, entity.getEyeHeight())), - (double) z, - 0.6F + world.rand.nextFloat() * 0.4F, - 0.0F, - 0.3F + world.rand.nextFloat() * 0.7F, - 20, - 0.0F); - break; - } - } - } - } + while (iterator.hasNext()) { + Entity entity = (Entity) iterator.next(); + if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer)) { + Thaumcraft.proxy.blockRunes( + world, + (double) x, + (double) ((float) y + 0.6F + + world.rand.nextFloat() + * Math.max(0.8F, entity.getEyeHeight())), + (double) z, + 0.6F + world.rand.nextFloat() * 0.4F, + 0.0F, + 0.3F + world.rand.nextFloat() * 0.7F, + 20, + 0.0F); + break; + } + } + } + } } } diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireAir.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireAir.java index 7fd7e046..58e660e8 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireAir.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireAir.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.block.fire; import java.util.HashMap; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -19,6 +21,7 @@ import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; public class BlockFireAir extends BlockFireBase { + @Override public String getBlockName() { return LibBlockNames.BLOCK_FIRE_AIR; @@ -28,16 +31,14 @@ public class BlockFireAir extends BlockFireBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableFire) return null; return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FIRE_AER, - new AspectList().add(Aspect.FIRE, 5).add(Aspect.AIR, 5), - 3, - -7, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AER)) - .setSecondary(); + LibResearch.KEY_FIRE_AER, + new AspectList().add(Aspect.FIRE, 5).add(Aspect.AIR, 5), + 3, + -7, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AER)) + .setSecondary(); } @Override @@ -67,8 +68,8 @@ public class BlockFireAir extends BlockFireBase { } @Override - public HashMap - getBlockTransformation(World w, int x, int y, int z) { + public HashMap getBlockTransformation( + World w, int x, int y, int z) { return getBlockTransformation(); } } diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireBase.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireBase.java index f630a6b0..3a39c6b8 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireBase.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireBase.java @@ -2,11 +2,10 @@ package thaumic.tinkerer.common.block.fire; import static net.minecraftforge.common.util.ForgeDirection.*; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.HashMap; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockFire; import net.minecraft.block.material.MapColor; @@ -22,12 +21,15 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.core.helper.BlockTuple; import thaumic.tinkerer.common.item.ItemBlockFire; import thaumic.tinkerer.common.registry.ITTinkererBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock { @@ -57,21 +59,20 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock public boolean isNeighborTarget(World w, int x, int y, int z) { for (ForgeDirection f : ForgeDirection.VALID_DIRECTIONS) { - if (w.blockExists(x + f.offsetX, y + f.offsetY, z + f.offsetZ) - && isTransmutationTarget( - w.getBlock(x + f.offsetX, y + f.offsetY, z + f.offsetZ), - w, - x + f.offsetX, - y + f.offsetY, - z + f.offsetZ)) { + if (w.blockExists(x + f.offsetX, y + f.offsetY, z + f.offsetZ) && isTransmutationTarget( + w.getBlock(x + f.offsetX, y + f.offsetY, z + f.offsetZ), + w, + x + f.offsetX, + y + f.offsetY, + z + f.offsetZ)) { return true; } } return false; } - public AxisAlignedBB getCollisionBoundingBoxFromPool( - World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { + public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, + int p_149668_4_) { return null; } @@ -117,16 +118,13 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock public void updateTick(World world, int x, int y, int z, Random rand) { - if (world.getGameRules().getGameRuleBooleanValue("doFireTick") - && ConfigHandler.enableFire + if (world.getGameRules().getGameRuleBooleanValue("doFireTick") && ConfigHandler.enableFire && ConfigHandler.enableFireMechanics) { - if (world.isRaining() - && (world.canLightningStrikeAt(x, y, z) - || world.canLightningStrikeAt(x - 1, y, z) - || world.canLightningStrikeAt(x + 1, y, z) - || world.canLightningStrikeAt(x, y, z - 1) - || world.canLightningStrikeAt(x, y, z + 1))) { + if (world.isRaining() && (world.canLightningStrikeAt(x, y, z) || world.canLightningStrikeAt(x - 1, y, z) + || world.canLightningStrikeAt(x + 1, y, z) + || world.canLightningStrikeAt(x, y, z - 1) + || world.canLightningStrikeAt(x, y, z + 1))) { world.setBlockToAir(x, y, z); } else { if (!isNeighborTarget(world, x, y, z)) { @@ -142,23 +140,33 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock y + dir.offsetY, z + dir.offsetZ)) { Random random = new Random(); - if (random.nextInt(getDecayChance( - world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) + if (random.nextInt( + getDecayChance(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) == 0) { world.setBlock( x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, getBlockTransformation( - world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) - .get(new BlockTuple(world.getBlock( - x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))) - .block, + world, + x + dir.offsetX, + y + dir.offsetY, + z + dir.offsetZ).get( + new BlockTuple( + world.getBlock( + x + dir.offsetX, + y + dir.offsetY, + z + dir.offsetZ))).block, getBlockTransformation( - world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) - .get(new BlockTuple(world.getBlock( - x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))) - .meta, + world, + x + dir.offsetX, + y + dir.offsetY, + z + dir.offsetZ).get( + new BlockTuple( + world.getBlock( + x + dir.offsetX, + y + dir.offsetY, + z + dir.offsetZ))).meta, 3); } else { world.setBlockToAir(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); @@ -210,8 +218,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock j2 /= 2; } - if (j2 > 0 - && rand.nextInt(l1) <= j2 + if (j2 > 0 && rand.nextInt(l1) <= j2 && (!world.isRaining() || !world.canLightningStrikeAt(i1, k1, j1)) && !world.canLightningStrikeAt(i1 - 1, k1, z) && !world.canLightningStrikeAt(i1 + 1, k1, j1) @@ -247,8 +254,8 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock return world.getBlock(x, y, z).getFlammability(world, x, y, z, face); } - private void tryCatchFire( - World world, int x, int y, int z, int strength, Random rand, int meta, ForgeDirection face) { + private void tryCatchFire(World world, int x, int y, int z, int strength, Random rand, int meta, + ForgeDirection face) { int j1 = getBlockFlammability(world, x, y, z, face); if (rand.nextInt(strength) < j1) { @@ -301,7 +308,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock } /** - * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z + * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z */ @Deprecated public boolean canBlockCatchFire(IBlockAccess p_149844_1_, int p_149844_2_, int p_149844_3_, int p_149844_4_) { @@ -314,13 +321,8 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock } @Override - public void onBlockPlacedBy( - World p_149689_1_, - int p_149689_2_, - int p_149689_3_, - int p_149689_4_, - EntityLivingBase p_149689_5_, - ItemStack p_149689_6_) { + public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, + EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { if (p_149689_5_ instanceof EntityPlayer) ThaumicTinkerer.log.info("Player: " + ((EntityPlayer) p_149689_5_).getDisplayName() + " placed TT Fire"); } @@ -469,10 +471,8 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { - this.icons = new IIcon[] { - IconHelper.forName(iconRegister, this.getBlockName() + "_layer_0"), - IconHelper.forName(iconRegister, this.getBlockName() + "_layer_1") - }; + this.icons = new IIcon[] { IconHelper.forName(iconRegister, this.getBlockName() + "_layer_0"), + IconHelper.forName(iconRegister, this.getBlockName() + "_layer_1") }; String s = ""; if (this instanceof BlockFireAir) { @@ -511,6 +511,7 @@ public abstract class BlockFireBase extends BlockFire implements ITTinkererBlock } private static class FireInfo { + public int encouragement = 0; public int flammibility = 0; diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireChaos.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireChaos.java index df7b63f8..58dcb879 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireChaos.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireChaos.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.block.fire; import java.util.HashMap; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -20,6 +22,7 @@ import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; public class BlockFireChaos extends BlockFireBase { + @Override public String getBlockName() { return LibBlockNames.BLOCK_FIRE_CHAOS; @@ -29,16 +32,17 @@ public class BlockFireChaos extends BlockFireBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableFire) return null; return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FIRE_PERDITIO, - new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), - 2, - -8, - 3, - new ItemStack(this)) - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_PERDITIO)) - .setSecondary(); + LibResearch.KEY_FIRE_PERDITIO, + new AspectList().add(Aspect.FIRE, 5).add(Aspect.ENTROPY, 5), + 2, + -8, + 3, + new ItemStack(this)) + .setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed() + .setPages( + new ResearchPage("0"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_PERDITIO)) + .setSecondary(); } @Override @@ -79,8 +83,8 @@ public class BlockFireChaos extends BlockFireBase { } @Override - public HashMap - getBlockTransformation(World w, int x, int y, int z) { + public HashMap getBlockTransformation( + World w, int x, int y, int z) { return getBlockTransformation(); } } diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireEarth.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireEarth.java index 48e5d8d1..3a326abc 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireEarth.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireEarth.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.block.fire; import java.util.HashMap; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -19,6 +21,7 @@ import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; public class BlockFireEarth extends BlockFireBase { + public BlockFireEarth() { super(); } @@ -32,16 +35,14 @@ public class BlockFireEarth extends BlockFireBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableFire) return null; return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FIRE_TERRA, - new AspectList().add(Aspect.FIRE, 5).add(Aspect.EARTH, 5), - 4, - -6, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_TERRA)) - .setSecondary(); + LibResearch.KEY_FIRE_TERRA, + new AspectList().add(Aspect.FIRE, 5).add(Aspect.EARTH, 5), + 4, + -6, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_TERRA)) + .setSecondary(); } @Override @@ -79,8 +80,8 @@ public class BlockFireEarth extends BlockFireBase { } @Override - public HashMap - getBlockTransformation(World w, int x, int y, int z) { + public HashMap getBlockTransformation( + World w, int x, int y, int z) { return getBlockTransformation(); } } diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireIgnis.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireIgnis.java index 95cb5362..c9086c5c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireIgnis.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireIgnis.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.block.fire; import java.util.HashMap; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -29,16 +31,14 @@ public class BlockFireIgnis extends BlockFireBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableFire) return null; return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FIRE_IGNIS, - new AspectList().add(Aspect.FIRE, 10), - 4, - -4, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_IGNIS)) - .setSecondary(); + LibResearch.KEY_FIRE_IGNIS, + new AspectList().add(Aspect.FIRE, 10), + 4, + -4, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_IGNIS)) + .setSecondary(); } @Override @@ -77,8 +77,8 @@ public class BlockFireIgnis extends BlockFireBase { } @Override - public HashMap - getBlockTransformation(World w, int x, int y, int z) { + public HashMap getBlockTransformation( + World w, int x, int y, int z) { return getBlockTransformation(); } } diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireOrder.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireOrder.java index 1a6f1917..6d0b777a 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireOrder.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireOrder.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.block.fire; import java.util.ArrayList; import java.util.HashMap; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -13,6 +14,7 @@ import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -49,16 +51,14 @@ public class BlockFireOrder extends BlockFireBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableFire) return null; return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FIRE_ORDO, - new AspectList().add(Aspect.FIRE, 5).add(Aspect.ORDER, 5), - 3, - -3, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_ORDO)) - .setSecondary(); + LibResearch.KEY_FIRE_ORDO, + new AspectList().add(Aspect.FIRE, 5).add(Aspect.ORDER, 5), + 3, + -3, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_ORDO)) + .setSecondary(); } @Override @@ -73,9 +73,7 @@ public class BlockFireOrder extends BlockFireBase { @Override public int getDecayChance(World world, int x, int y, int z) { - int dropSize = world.getBlock(x, y, z) - .getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0) - .size(); + int dropSize = world.getBlock(x, y, z).getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0).size(); if (dropSize == 2) { return 2; } @@ -92,17 +90,10 @@ public class BlockFireOrder extends BlockFireBase { if (ore.startsWith("ore")) { for (String block : OreDictionary.getOreNames()) { if (block.startsWith("block") && block.substring(5).equalsIgnoreCase(ore.substring(3))) { - if (OreDictionary.getOres(block).size() > 0 - && OreDictionary.getOres(ore).size() > 0) { + if (OreDictionary.getOres(block).size() > 0 && OreDictionary.getOres(ore).size() > 0) { result.put( - ((ItemBlock) OreDictionary.getOres(ore) - .get(0) - .getItem()) - .field_150939_a, - ((ItemBlock) OreDictionary.getOres(block) - .get(0) - .getItem()) - .field_150939_a); + ((ItemBlock) OreDictionary.getOres(ore).get(0).getItem()).field_150939_a, + ((ItemBlock) OreDictionary.getOres(block).get(0).getItem()).field_150939_a); } } } @@ -125,15 +116,13 @@ public class BlockFireOrder extends BlockFireBase { } public ItemStack getBlockCraftingResult(World w, ItemStack itemStack) { - InventoryCrafting blockCraftInventory = new InventoryCrafting( - new Container() { - @Override - public boolean canInteractWith(EntityPlayer entityPlayer) { - return false; - } - }, - 3, - 3); + InventoryCrafting blockCraftInventory = new InventoryCrafting(new Container() { + + @Override + public boolean canInteractWith(EntityPlayer entityPlayer) { + return false; + } + }, 3, 3); for (int i = 0; i < 9; i++) { blockCraftInventory.setInventorySlotContents(i, itemStack); diff --git a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireWater.java b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireWater.java index 0b0ac2a0..6f70041a 100644 --- a/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireWater.java +++ b/src/main/java/thaumic/tinkerer/common/block/fire/BlockFireWater.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.block.fire; import java.util.HashMap; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -19,6 +21,7 @@ import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; public class BlockFireWater extends BlockFireBase { + public BlockFireWater() { super(); } @@ -32,16 +35,14 @@ public class BlockFireWater extends BlockFireBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableFire) return null; return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FIRE_AQUA, - new AspectList().add(Aspect.FIRE, 5).add(Aspect.WATER, 5), - 2, - -2, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_BRIGHT_NITOR) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AQUA)) - .setSecondary(); + LibResearch.KEY_FIRE_AQUA, + new AspectList().add(Aspect.FIRE, 5).add(Aspect.WATER, 5), + 2, + -2, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_BRIGHT_NITOR).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_FIRE_AQUA)) + .setSecondary(); } @Override @@ -67,8 +68,8 @@ public class BlockFireWater extends BlockFireBase { } @Override - public HashMap - getBlockTransformation(World w, int x, int y, int z) { + public HashMap getBlockTransformation( + World w, int x, int y, int z) { return getBlockTransformation(); } } diff --git a/src/main/java/thaumic/tinkerer/common/block/kami/BlockBedrockPortal.java b/src/main/java/thaumic/tinkerer/common/block/kami/BlockBedrockPortal.java index 51c753e2..08820af9 100644 --- a/src/main/java/thaumic/tinkerer/common/block/kami/BlockBedrockPortal.java +++ b/src/main/java/thaumic/tinkerer/common/block/kami/BlockBedrockPortal.java @@ -1,9 +1,7 @@ package thaumic.tinkerer.common.block.kami; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -22,6 +20,7 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.WorldServer; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.block.BlockMod; import thaumic.tinkerer.common.block.tile.kami.TileBedrockPortal; @@ -32,6 +31,9 @@ import thaumic.tinkerer.common.dim.WorldProviderBedrock; import thaumic.tinkerer.common.lib.LibBlockNames; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockBedrockPortal extends BlockMod { @@ -47,16 +49,8 @@ public class BlockBedrockPortal extends BlockMod { } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer p_149727_5_, - int p_149727_6_, - float p_149727_7_, - float p_149727_8_, - float p_149727_9_) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_, + float p_149727_7_, float p_149727_8_, float p_149727_9_) { world.setBlock(x, y, z, Blocks.bedrock); return super.onBlockActivated(world, x, y, z, p_149727_5_, p_149727_6_, p_149727_7_, p_149727_8_, p_149727_9_); } @@ -114,12 +108,10 @@ public class BlockBedrockPortal extends BlockMod { boolean flag = (par1IBlockAccess.getBlockMetadata(i1, j1, k1) & 8) != 0; return flag ? (par5 == 0 - || (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) - ? true + || (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : true)) : (par5 == 1 - || (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) - ? true + || (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : true)); } } @@ -132,9 +124,7 @@ public class BlockBedrockPortal extends BlockMod { if (entity instanceof EntityPlayer && !par1World.isRemote) { - FMLCommonHandler.instance() - .getMinecraftServerInstance() - .getConfigurationManager() + FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager() .transferPlayerToDimension( (EntityPlayerMP) entity, ConfigHandler.bedrockDimensionID, @@ -159,11 +149,11 @@ public class BlockBedrockPortal extends BlockMod { } else if (entity.worldObj.provider instanceof WorldProviderBedrock) { if (entity instanceof EntityPlayer && !par1World.isRemote) { - FMLCommonHandler.instance() - .getMinecraftServerInstance() - .getConfigurationManager() + FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager() .transferPlayerToDimension( - (EntityPlayerMP) entity, 0, new TeleporterBedrock((WorldServer) par1World)); + (EntityPlayerMP) entity, + 0, + new TeleporterBedrock((WorldServer) par1World)); Random rand = new Random(); @@ -208,8 +198,7 @@ public class BlockBedrockPortal extends BlockMod { e.worldObj.removeEntity(e); e.isDead = false; e.worldObj.theProfiler.startSection("reposition"); - minecraftserver - .getConfigurationManager() + minecraftserver.getConfigurationManager() .transferEntityToWorld(e, j, worldserver, worldserver1, new TeleporterBedrock(worldserver)); e.worldObj.theProfiler.endStartSection("reloading"); Entity entity = EntityList.createEntityByName(EntityList.getEntityString(e), worldserver1); @@ -219,8 +208,8 @@ public class BlockBedrockPortal extends BlockMod { if (j == 1 && par1 == 1) { ChunkCoordinates chunkcoordinates = worldserver1.getSpawnPoint(); - chunkcoordinates.posY = - e.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ); + chunkcoordinates.posY = e.worldObj + .getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ); entity.setLocationAndAngles( (double) chunkcoordinates.posX, (double) chunkcoordinates.posY, diff --git a/src/main/java/thaumic/tinkerer/common/block/kami/BlockWarpGate.java b/src/main/java/thaumic/tinkerer/common/block/kami/BlockWarpGate.java index 1138618a..fa57dffd 100644 --- a/src/main/java/thaumic/tinkerer/common/block/kami/BlockWarpGate.java +++ b/src/main/java/thaumic/tinkerer/common/block/kami/BlockWarpGate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 3:54:41 PM (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.block.kami; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -28,6 +26,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -65,22 +64,14 @@ public class BlockWarpGate extends BlockModContainer { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { if (!par1World.isRemote) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); if (tile != null) { par1World.markBlockForUpdate(par2, par3, par4); - par5EntityPlayer.openGui( - ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_WARP_GATE, par1World, par2, par3, par4); + par5EntityPlayer + .openGui(ThaumicTinkerer.instance, LibGuiIDs.GUI_ID_WARP_GATE, par1World, par2, par3, par4); } } @@ -100,9 +91,8 @@ public class BlockWarpGate extends BlockModContainer { float f1 = random.nextFloat() * 0.8F + 0.1F; EntityItem entityitem; - for (float f2 = random.nextFloat() * 0.8F + 0.1F; - itemstack.stackSize > 0; - par1World.spawnEntityInWorld(entityitem)) { + for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World + .spawnEntityInWorld(entityitem)) { int k1 = random.nextInt(21) + 10; if (k1 > itemstack.stackSize) k1 = itemstack.stackSize; @@ -119,9 +109,8 @@ public class BlockWarpGate extends BlockModContainer { entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F; entityitem.motionZ = (float) random.nextGaussian() * f3; - if (itemstack.hasTagCompound()) - entityitem.getEntityItem().setTagCompound((NBTTagCompound) - itemstack.getTagCompound().copy()); + if (itemstack.hasTagCompound()) entityitem.getEntityItem() + .setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); } } } @@ -199,23 +188,18 @@ public class BlockWarpGate extends BlockModContainer { } if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_WARP_GATE, - new AspectList() - .add(Aspect.TRAVEL, 2) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.FLIGHT, 1) - .add(Aspect.MECHANISM, 1), - 19, - 6, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_CHEST_GEM) - .setParentsHidden(LibResearch.KEY_ICHORCLOTH_BOOTS_GEM) - .setPages( - new ResearchPage("0"), - ResearchHelper.infusionPage(LibResearch.KEY_WARP_GATE), - new ResearchPage("1"), - ResearchHelper.infusionPage(LibResearch.KEY_SKY_PEARL)); + LibResearch.KEY_WARP_GATE, + new AspectList().add(Aspect.TRAVEL, 2).add(Aspect.ELDRITCH, 1).add(Aspect.FLIGHT, 1) + .add(Aspect.MECHANISM, 1), + 19, + 6, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_CHEST_GEM) + .setParentsHidden(LibResearch.KEY_ICHORCLOTH_BOOTS_GEM).setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_WARP_GATE), + new ResearchPage("1"), + ResearchHelper.infusionPage(LibResearch.KEY_SKY_PEARL)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizer.java b/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizer.java index 00105e2a..bc58f506 100644 --- a/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizer.java +++ b/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizer.java @@ -1,7 +1,5 @@ package thaumic.tinkerer.common.block.mobilizer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Items; @@ -11,6 +9,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -25,6 +24,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockMobilizer extends BlockMod { @@ -72,8 +73,7 @@ public class BlockMobilizer extends BlockMod { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int meta) { - return par1 == ForgeDirection.UP.ordinal() - ? iconTop + return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSide; } @@ -95,18 +95,18 @@ public class BlockMobilizer extends BlockMod { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_MOBILIZER, - new AspectList().add(Aspect.MOTION, 2).add(Aspect.ORDER, 2), - -7, - 5, - 3, - new ItemStack(this)) - .setParents(LibResearch.KEY_MAGNETS) - .setPages( - new ResearchPage("0"), - ResearchHelper.infusionPage(LibResearch.KEY_MOBILIZER), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_RELAY)) - .setSecondary(); + LibResearch.KEY_MOBILIZER, + new AspectList().add(Aspect.MOTION, 2).add(Aspect.ORDER, 2), + -7, + 5, + 3, + new ItemStack(this)) + .setParents(LibResearch.KEY_MAGNETS) + .setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_MOBILIZER), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_RELAY)) + .setSecondary(); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizerRelay.java b/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizerRelay.java index 8b5a3242..0e370ae6 100644 --- a/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizerRelay.java +++ b/src/main/java/thaumic/tinkerer/common/block/mobilizer/BlockMobilizerRelay.java @@ -1,7 +1,5 @@ package thaumic.tinkerer.common.block.mobilizer; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; @@ -12,6 +10,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; @@ -24,6 +23,8 @@ import thaumic.tinkerer.common.lib.LibResearch; import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockMobilizerRelay extends BlockMod { @@ -61,8 +62,7 @@ public class BlockMobilizerRelay extends BlockMod { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int meta) { - return par1 == ForgeDirection.UP.ordinal() - ? iconTop + return par1 == ForgeDirection.UP.ordinal() ? iconTop : par1 == ForgeDirection.DOWN.ordinal() ? iconBottom : iconSide; } diff --git a/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartz.java b/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartz.java index 7f7dbb12..6d146ce7 100644 --- a/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartz.java +++ b/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartz.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 15:59:00 (GMT)] */ package thaumic.tinkerer.common.block.quartz; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -27,6 +23,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockMod; @@ -38,11 +35,13 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipeMulti; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockDarkQuartz extends BlockMod { - private static final String[] iconNames = - new String[] {"darkQuartz0", "chiseledDarkQuartz0", "pillarDarkQuartz0", null, null}; + private static final String[] iconNames = new String[] { "darkQuartz0", "chiseledDarkQuartz0", "pillarDarkQuartz0", + null, null }; private IIcon[] darkQuartzIcons; private IIcon chiseledDarkQuartzIcon; private IIcon pillarDarkQuartzIcon; @@ -66,17 +65,14 @@ public class BlockDarkQuartz extends BlockMod { return darkQuartzIcons[par2]; } } else return par2 == 1 ? chiseledDarkQuartzIcon : darkQuartzTopIcon; - } else - return par2 == 2 && (par1 == 1 || par1 == 0) - ? pillarDarkQuartzIcon - : par2 == 3 && (par1 == 5 || par1 == 4) - ? pillarDarkQuartzIcon - : par2 == 4 && (par1 == 2 || par1 == 3) ? pillarDarkQuartzIcon : darkQuartzIcons[par2]; + } else return par2 == 2 && (par1 == 1 || par1 == 0) ? pillarDarkQuartzIcon + : par2 == 3 && (par1 == 5 || par1 == 4) ? pillarDarkQuartzIcon + : par2 == 4 && (par1 == 2 || par1 == 3) ? pillarDarkQuartzIcon : darkQuartzIcons[par2]; } @Override - public int onBlockPlaced( - World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { + public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, + float par8, int par9) { if (par9 == 2) { switch (par5) { case 0: diff --git a/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzSlab.java b/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzSlab.java index 7a5a2ae9..912ff4fd 100644 --- a/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzSlab.java +++ b/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzSlab.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 15:59:37 (GMT)] */ package thaumic.tinkerer.common.block.quartz; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.BlockSlab; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -26,6 +22,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.ModCreativeTab; import thaumic.tinkerer.common.item.quartz.ItemDarkQuartzSlab; @@ -35,6 +32,8 @@ import thaumic.tinkerer.common.registry.ITTinkererBlock; import thaumic.tinkerer.common.registry.ThaumicTinkererCraftingBenchRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock { @@ -59,9 +58,7 @@ public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock { @Override @SideOnly(Side.CLIENT) public IIcon getIcon(int par1, int par2) { - return ThaumicTinkerer.registry - .getFirstBlockFromClass(BlockDarkQuartz.class) - .getBlockTextureFromSide(par1); + return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartz.class).getBlockTextureFromSide(par1); } @Override @@ -71,7 +68,7 @@ public class BlockDarkQuartzSlab extends BlockSlab implements ITTinkererBlock { // @Override // public int idDropped(int par1, Random par2Random, int par3) { - // return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID; + // return ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class).blockID; // } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzStairs.java b/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzStairs.java index 42493c97..a76eb440 100644 --- a/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzStairs.java +++ b/src/main/java/thaumic/tinkerer/common/block/quartz/BlockDarkQuartzStairs.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 16:02:19 (GMT)] @@ -15,10 +12,12 @@ package thaumic.tinkerer.common.block.quartz; import java.util.ArrayList; + import net.minecraft.block.BlockStairs; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.ModCreativeTab; import thaumic.tinkerer.common.lib.LibBlockNames; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileAspectAnalyzer.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileAspectAnalyzer.java index 3c299510..ae9d5c9a 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileAspectAnalyzer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileAspectAnalyzer.java @@ -1,30 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 10:33:26 PM (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; -import cpw.mods.fml.common.Optional; -import dan200.computercraft.api.lua.ILuaContext; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; import java.util.HashMap; import java.util.Map; + import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -32,15 +26,19 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager; import thaumic.tinkerer.common.lib.LibBlockNames; +import appeng.api.movable.IMovableTile; +import cpw.mods.fml.common.Optional; +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; -@Optional.InterfaceList({ - @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), - @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") -}) +@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), + @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") }) public class TileAspectAnalyzer extends TileEntity implements IInventory, SimpleComponent, IPeripheral, IMovableTile { ItemStack[] inventorySlots = new ItemStack[1]; @@ -154,7 +152,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple @Override public String[] getMethodNames() { - return new String[] {"hasItem", "itemHasAspects", "getAspects", "getAspectCount"}; + return new String[] { "hasItem", "itemHasAspects", "getAspects", "getAspectCount" }; } @Override @@ -176,7 +174,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple public Object[] hasItemMethod() { ItemStack stack = getStackInSlot(0); - return new Object[] {stack != null}; + return new Object[] { stack != null }; } public AspectList getAspectList() { @@ -193,25 +191,25 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple public Object[] itemHasAspectsMethod() { AspectList aspects = getAspectList(); - return new Object[] {aspects != null && aspects.size() > 0}; + return new Object[] { aspects != null && aspects.size() > 0 }; } public Object[] getAspectsMethod() { AspectList aspects = getAspectList(); Map retVals = new HashMap(); - if (aspects == null) return new Object[] {retVals}; + if (aspects == null) return new Object[] { retVals }; double i = 1; for (Aspect aspect : aspects.getAspectsSorted()) retVals.put(i++, aspect.getTag()); - return new Object[] {retVals}; + return new Object[] { retVals }; } public Object[] getAspectsAmountsMethod() { AspectList aspects = getAspectList(); Map retVals = new HashMap(); - if (aspects == null) return new Object[] {retVals}; + if (aspects == null) return new Object[] { retVals }; for (Aspect aspect : aspects.getAspectsSorted()) retVals.put(aspect.getTag(), (double) aspects.getAmount(aspect)); - return new Object[] {retVals}; + return new Object[] { retVals }; } @Override @@ -248,7 +246,7 @@ public class TileAspectAnalyzer extends TileEntity implements IInventory, Simple @Callback @Optional.Method(modid = "OpenComputers") public Object[] greet(Context context, Arguments args) { - return new Object[] {String.format("Hello, %s!", args.checkString(0))}; + return new Object[] { String.format("Hello, %s!", args.checkString(0)) }; } @Callback(doc = "function():boolean -- Whether this inventory contains an item") diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileCamo.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileCamo.java index 6cdb7f32..ab67e4db 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileCamo.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileCamo.java @@ -1,26 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 6:26:18 PM (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import appeng.api.movable.IMovableTile; + public class TileCamo extends TileEntity implements IMovableTile { private static final String TAG_CAMO = "camo"; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileEnchanter.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileEnchanter.java index 26e7c7e2..5f9d2a41 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileEnchanter.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileEnchanter.java @@ -1,24 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 01:07:25 (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.EntityPlayer; @@ -30,7 +25,9 @@ import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; + import org.apache.commons.lang3.ArrayUtils; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.Thaumcraft; @@ -40,6 +37,9 @@ import thaumic.tinkerer.common.core.helper.Tuple4Int; import thaumic.tinkerer.common.enchantment.core.EnchantmentManager; import thaumic.tinkerer.common.lib.LibBlockNames; import thaumic.tinkerer.common.lib.LibFeatures; +import appeng.api.movable.IMovableTile; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; public class TileEnchanter extends TileEntity implements ISidedInventory, IMovableTile { @@ -105,10 +105,9 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab checkPillars(); if (!working) // Pillar check - return; + return; - enchantItem: - { + enchantItem: { for (Aspect aspect : LibFeatures.PRIMAL_ASPECTS) { int currentAmount = currentAspects.getAmount(aspect); int totalAmount = totalAspects.getAmount(aspect); @@ -136,8 +135,7 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab ItemStack wand = getStackInSlot(1); - if (wand != null - && wand.getItem() instanceof ItemWandCasting + if (wand != null && wand.getItem() instanceof ItemWandCasting && !((ItemWandCasting) wand.getItem()).isStaff(wand)) { ItemWandCasting wandItem = (ItemWandCasting) wand.getItem(); AspectList wandAspects = wandItem.getAllVis(wand); @@ -202,8 +200,8 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab } } - public boolean consumeAllVisCrafting( - ItemStack is, EntityPlayer player, AspectList aspects, boolean doit, ItemWandCasting wandItem) { + public boolean consumeAllVisCrafting(ItemStack is, EntityPlayer player, AspectList aspects, boolean doit, + ItemWandCasting wandItem) { if (aspects != null && aspects.size() != 0) { AspectList aspectList = new AspectList(); Aspect[] aspectArray = aspects.getAspects(); @@ -292,13 +290,12 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab public boolean assignPillars() { int y = yCoord; - for (int x = xCoord - 4; x <= xCoord + 4; x++) - for (int z = zCoord - 4; z <= zCoord + 4; z++) { - int height = findPillar(x, y, z); - if (height != -1) pillars.add(new Tuple4Int(x, y, z, height)); + for (int x = xCoord - 4; x <= xCoord + 4; x++) for (int z = zCoord - 4; z <= zCoord + 4; z++) { + int height = findPillar(x, y, z); + if (height != -1) pillars.add(new Tuple4Int(x, y, z, height)); - if (pillars.size() == 6) return false; - } + if (pillars.size() == 6) return false; + } pillars.clear(); return true; @@ -372,7 +369,8 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab par1NBTTagCompound.setIntArray(TAG_LEVELS, ArrayUtils.toPrimitive(levels.toArray(new Integer[levels.size()]))); par1NBTTagCompound.setIntArray( - TAG_ENCHANTS, ArrayUtils.toPrimitive(enchantments.toArray(new Integer[enchantments.size()]))); + TAG_ENCHANTS, + ArrayUtils.toPrimitive(enchantments.toArray(new Integer[enchantments.size()]))); NBTTagCompound totalAspectsCmp = new NBTTagCompound(); totalAspects.writeToNBT(totalAspectsCmp); diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityMobilizer.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityMobilizer.java index 792aa00f..3bbdb291 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityMobilizer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityMobilizer.java @@ -1,15 +1,16 @@ package thaumic.tinkerer.common.block.tile; -import appeng.api.AEApi; -import appeng.api.IAppEngApi; -import appeng.api.movable.IMovableTile; import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer; +import appeng.api.AEApi; +import appeng.api.IAppEngApi; +import appeng.api.movable.IMovableTile; public class TileEntityMobilizer extends TileEntity { @@ -59,8 +60,7 @@ public class TileEntityMobilizer extends TileEntity { if (te instanceof TileEntityRelay) { ((TileEntityRelay) te).verifyPartner(); } - if (!(linked - && te instanceof TileEntityRelay + if (!(linked && te instanceof TileEntityRelay && ((TileEntityRelay) te).partnerX == this.secondRelayX && ((TileEntityRelay) te).partnerZ == this.secondRelayZ)) { linked = false; @@ -74,8 +74,7 @@ public class TileEntityMobilizer extends TileEntity { // Make sure the relays haven't been broken verifyRelay(); // Bounce - if (linked - && worldObj.getTotalWorldTime() % 100 == 0 + if (linked && worldObj.getTotalWorldTime() % 100 == 0 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { // Target coordinates to check int targetX = xCoord + movementDirection.offsetX; @@ -87,8 +86,7 @@ public class TileEntityMobilizer extends TileEntity { } } // Move - if (linked - && worldObj.getTotalWorldTime() % 100 == 1 + if (linked && worldObj.getTotalWorldTime() % 100 == 1 && !worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { // Cache coordinated int targetX = xCoord + movementDirection.offsetX; @@ -111,7 +109,7 @@ public class TileEntityMobilizer extends TileEntity { // AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord+1, yCoord+3, zCoord+1)); // System.out.print(entities); // for(Entity e: entities){ - // e.setPosition(e.posX+movementDirection.offsetX, e.posY, e.posZ+movementDirection.offsetZ); + // e.setPosition(e.posX+movementDirection.offsetX, e.posY, e.posZ+movementDirection.offsetZ); // } // Move the block on top of the mobilizer @@ -155,9 +153,7 @@ public class TileEntityMobilizer extends TileEntity { 3); passenger.invalidate(); worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord); - api.registries() - .movable() - .getHandler(passenger) + api.registries().movable().getHandler(passenger) .moveTile(passenger, worldObj, targetX, yCoord + 1, targetZ); api.registries().movable().doneMoving(passenger); passenger.validate(); @@ -166,30 +162,30 @@ public class TileEntityMobilizer extends TileEntity { // Handler IMovableTiles and vanilla TEs without AE } else if (passenger instanceof IMovableTile || passenger.getClass().getName().startsWith("net.minecraft.tileentity")) { - boolean imovable = passenger instanceof IMovableTile; - if (imovable) ((IMovableTile) passenger).prepareToMove(); - worldObj.setBlock( - targetX, - yCoord + 1, - targetZ, - worldObj.getBlock(xCoord, yCoord + 1, zCoord), - worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), - 3); - passenger.invalidate(); - worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord); + boolean imovable = passenger instanceof IMovableTile; + if (imovable) ((IMovableTile) passenger).prepareToMove(); + worldObj.setBlock( + targetX, + yCoord + 1, + targetZ, + worldObj.getBlock(xCoord, yCoord + 1, zCoord), + worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), + 3); + passenger.invalidate(); + worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord); - // IMovableHandler default code - Chunk c = worldObj.getChunkFromBlockCoords(targetX, targetZ); + // IMovableHandler default code + Chunk c = worldObj.getChunkFromBlockCoords(targetX, targetZ); - c.func_150812_a(targetX & 0xF, yCoord + 1, targetZ & 0xF, passenger); + c.func_150812_a(targetX & 0xF, yCoord + 1, targetZ & 0xF, passenger); - if (c.isChunkLoaded) { - worldObj.addTileEntity(passenger); - worldObj.markBlockForUpdate(targetX, yCoord + 1, targetZ); - } - if (imovable) ((IMovableTile) passenger).doneMoving(); - passenger.validate(); - } + if (c.isChunkLoaded) { + worldObj.addTileEntity(passenger); + worldObj.markBlockForUpdate(targetX, yCoord + 1, targetZ); + } + if (imovable) ((IMovableTile) passenger).doneMoving(); + passenger.validate(); + } } // Move self this.invalidate(); diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityRelay.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityRelay.java index 13ff584e..526c344f 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityRelay.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileEntityRelay.java @@ -1,10 +1,11 @@ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; + import thaumic.tinkerer.common.ThaumicTinkerer; +import appeng.api.movable.IMovableTile; public class TileEntityRelay extends TileEntity implements IMovableTile { @@ -16,8 +17,7 @@ public class TileEntityRelay extends TileEntity implements IMovableTile { public void verifyPartner() { TileEntity te = worldObj.getTileEntity(partnerX, yCoord, partnerZ); - if (!(hasPartner - && te instanceof TileEntityRelay + if (!(hasPartner && te instanceof TileEntityRelay && ((TileEntityRelay) te).partnerX == this.xCoord && ((TileEntityRelay) te).partnerZ == this.zCoord)) { hasPartner = false; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileForcefield.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileForcefield.java index 7e20bd9c..e18f5a0c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileForcefield.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileForcefield.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.block.tile; import net.minecraft.tileentity.TileEntity; + import thaumic.tinkerer.common.ThaumicTinkerer; /** diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileFunnel.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileFunnel.java index a9e1275d..a9efe127 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileFunnel.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileFunnel.java @@ -1,20 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [28 Sep 2013, 19:34:46 (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; import net.minecraft.block.BlockHopper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -28,6 +24,7 @@ import net.minecraft.tileentity.TileEntityHopper; import net.minecraft.util.Facing; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; @@ -36,6 +33,7 @@ import thaumcraft.common.blocks.ItemJarFilled; import thaumcraft.common.tiles.TileJarFillable; import thaumcraft.common.tiles.TileJarFillableVoid; import thaumic.tinkerer.common.lib.LibBlockNames; +import appeng.api.movable.IMovableTile; public class TileFunnel extends TileEntity implements ISidedInventory, IAspectContainer, IMovableTile { @@ -54,21 +52,20 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo TileEntity tile = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); if (tile != null && tile instanceof TileEntityHopper) { - TileEntity tile1 = - getHopperFacing(tile.xCoord, tile.yCoord, tile.zCoord, tile.getBlockMetadata()); + TileEntity tile1 = getHopperFacing( + tile.xCoord, + tile.yCoord, + tile.zCoord, + tile.getBlockMetadata()); if (tile1 instanceof TileJarFillable) { TileJarFillable jar1 = (TileJarFillable) tile1; boolean voidJar = tile1 instanceof TileJarFillableVoid; AspectList aspectList1 = jar1.getAspects(); - //noinspection ConstantConditions - if (aspectList1 != null - && aspectList1.size() == 0 - && (jar1.aspectFilter == null || jar1.aspectFilter == aspect) + // noinspection ConstantConditions + if (aspectList1 != null && aspectList1.size() == 0 + && (jar1.aspectFilter == null || jar1.aspectFilter == aspect) || aspectList1.getAspects()[0] == aspect - && (aspectList1.getAmount( - aspectList1.getAspects()[0]) - < 64 - || voidJar)) { + && (aspectList1.getAmount(aspectList1.getAspects()[0]) < 64 || voidJar)) { jar1.addToContainer(aspect, 1); item.setAspects(jar, aspectList.remove(aspect, 1)); } @@ -88,7 +85,9 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo private TileEntity getHopperFacing(int x, int y, int z, int meta) { int i = BlockHopper.getDirectionFromMetadata(meta); return worldObj.getTileEntity( - x + Facing.offsetsXForSide[i], y + Facing.offsetsYForSide[i], z + Facing.offsetsZForSide[i]); + x + Facing.offsetsXForSide[i], + y + Facing.offsetsYForSide[i], + z + Facing.offsetsZForSide[i]); } @Override @@ -138,15 +137,15 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo AspectList aspects = getAspects(); // if(inventorySlots[i] != null && inventorySlots[i].itemID == ConfigItems.itemJarFilled.itemID && aspects == // null) { - // Aspect filter=((ItemJarFilled)inventorySlots[i].getItem()).getFilter(inventorySlots[i]); - // inventorySlots[i] = new ItemStack(ConfigBlocks.blockJar,1,inventorySlots[i].getItemDamage()); - // if(filter!=null) - // { - // if(inventorySlots[i].getTagCompound()==null) - // inventorySlots[i].setTagCompound(new NBTTagCompound()); - // inventorySlots[i].getTagCompound().setString("AspectFilter",filter.getTag()); - // } - // onInventoryChanged(); + // Aspect filter=((ItemJarFilled)inventorySlots[i].getItem()).getFilter(inventorySlots[i]); + // inventorySlots[i] = new ItemStack(ConfigBlocks.blockJar,1,inventorySlots[i].getItemDamage()); + // if(filter!=null) + // { + // if(inventorySlots[i].getTagCompound()==null) + // inventorySlots[i].setTagCompound(new NBTTagCompound()); + // inventorySlots[i].getTagCompound().setString("AspectFilter",filter.getTag()); + // } + // onInventoryChanged(); // } return inventorySlots[i]; @@ -230,7 +229,7 @@ public class TileFunnel extends TileEntity implements ISidedInventory, IAspectCo @Override public int[] getAccessibleSlotsFromSide(int var1) { - return var1 == ForgeDirection.DOWN.ordinal() ? new int[0] : new int[] {0}; + return var1 == ForgeDirection.DOWN.ordinal() ? new int[0] : new int[] { 0 }; } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileGolemConnector.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileGolemConnector.java index 3c1ca17d..02009b9b 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileGolemConnector.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileGolemConnector.java @@ -1,29 +1,31 @@ package thaumic.tinkerer.common.block.tile; +import java.util.*; + +import li.cil.oc.api.machine.Arguments; +import li.cil.oc.api.machine.Callback; +import li.cil.oc.api.machine.Context; +import li.cil.oc.api.network.SimpleComponent; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.StatCollector; + +import thaumcraft.common.entities.golems.EntityGolemBase; +import thaumcraft.common.entities.golems.Marker; +import thaumic.tinkerer.common.core.golems.EnumGolemCores; +import thaumic.tinkerer.common.core.golems.EnumGolemDecorations; import cpw.mods.fml.common.Optional; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import java.util.*; -import li.cil.oc.api.machine.Arguments; -import li.cil.oc.api.machine.Callback; -import li.cil.oc.api.machine.Context; -import li.cil.oc.api.network.SimpleComponent; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import thaumcraft.common.entities.golems.EntityGolemBase; -import thaumcraft.common.entities.golems.Marker; -import thaumic.tinkerer.common.core.golems.EnumGolemCores; -import thaumic.tinkerer.common.core.golems.EnumGolemDecorations; -@Optional.InterfaceList({ - @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), - @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") -}) +@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), + @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") }) public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleComponent { + private static final String TAG_UUID_MOST = "UUIDMost"; private static final String TAG_UUID_LEAST = "UUIDLeast"; public UUID golemConnected; @@ -38,8 +40,8 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC if (golemConnected == null) return; List list = this.worldObj.getEntitiesWithinAABB( EntityGolemBase.class, - AxisAlignedBB.getBoundingBox( - xCoord - 30, yCoord - 30, zCoord - 30, xCoord + 30, yCoord + 30, zCoord + 30)); + AxisAlignedBB + .getBoundingBox(xCoord - 30, yCoord - 30, zCoord - 30, xCoord + 30, yCoord + 30, zCoord + 30)); Iterator iterator = list.iterator(); while (iterator.hasNext()) { @@ -67,12 +69,13 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC decorations.put((double) i, StatCollector.translateToLocal(golemDec.getName())); } - return new Object[] {decorations}; + return new Object[] { decorations }; } public String[] getGolemCoreImplementation() throws LuaException { if (golem == null) return new String[] {}; - if (golem.getCore() == -1) return new String[] {StatCollector.translateToLocal("item.ItemGolemCore.100.name")}; + if (golem.getCore() == -1) + return new String[] { StatCollector.translateToLocal("item.ItemGolemCore.100.name") }; String[] decorations = new String[1]; EnumGolemCores golemCore = EnumGolemCores.getFromByte(golem.getCore()); if (golemCore == null) throw new LuaException("Golem has Unknown core: " + golem.getCore()); @@ -117,23 +120,9 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC @Override public String[] getMethodNames() { - return new String[] { - "getDecorations", - "getPosition", - "getType", - "getHealth", - "getCore", - "getHome", - "setHome", - "getMarkers", - "setMarkers", - "newMarker", - "addMarker", - "saveMarker", - "deleteMarker", - "getMarker", - "getMarkerCount" - }; + return new String[] { "getDecorations", "getPosition", "getType", "getHealth", "getCore", "getHome", "setHome", + "getMarkers", "setMarkers", "newMarker", "addMarker", "saveMarker", "deleteMarker", "getMarker", + "getMarkerCount" }; } @Override @@ -145,12 +134,12 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC return getGolemDecorationsImplementation(); case 1: if (golem == null) return new Integer[] {}; - return new Integer[] {(int) golem.posX, (int) golem.posY, (int) golem.posZ}; + return new Integer[] { (int) golem.posX, (int) golem.posY, (int) golem.posZ }; case 2: return getGolemTypeImplementation(); case 3: if (golem == null) return new Float[] {}; - return new Float[] {golem.getHealth()}; + return new Float[] { golem.getHealth() }; case 4: return getGolemCoreImplementation(); case 5: @@ -190,8 +179,8 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC private Object[] getMarkerCountImplementation() { if (golem == null) return new String[] {}; ArrayList markers = golem.getMarkers(); - if (markers == null) return new Object[] {0}; - return new Object[] {(double) markers.size()}; + if (markers == null) return new Object[] { 0 }; + return new Object[] { (double) markers.size() }; } private Object[] getMarkerImplementation(Double arguments) throws LuaException { @@ -201,7 +190,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC throw new LuaException("marker " + (int) (double) arguments + " does not exist"); Marker mark = markers.get((int) (double) arguments); - return new Object[] {fromMarkerImplementation(mark)}; + return new Object[] { fromMarkerImplementation(mark) }; } private Object[] deleteMarkerImplementation(double arguments) throws LuaException { @@ -244,7 +233,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC mark.put("dim", this.worldObj.provider.dimensionId); mark.put("color", -1); mark.put("side", 1); - return new Object[] {mark}; + return new Object[] { mark }; } @SuppressWarnings("unchecked") @@ -285,7 +274,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC HashMap luaMarker = fromMarkerImplementation(mark); luaMarkers.put(i++, luaMarker); } - return new Object[] {luaMarkers}; + return new Object[] { luaMarkers }; } /** @@ -315,28 +304,28 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC private Object[] getHomeImplementation() { if (golem == null) return new String[] {}; ChunkCoordinates home = golem.getHomePosition(); - return new Integer[] {home.posX, home.posY, home.posZ, golem.homeFacing}; + return new Integer[] { home.posX, home.posY, home.posZ, golem.homeFacing }; } private String[] getGolemTypeImplementation() throws LuaException { if (golem == null) return new String[] {}; switch (golem.getGolemType()) { case CLAY: - return new String[] {"Clay"}; + return new String[] { "Clay" }; case FLESH: - return new String[] {"Flesh"}; + return new String[] { "Flesh" }; case IRON: - return new String[] {"Iron"}; + return new String[] { "Iron" }; case STONE: - return new String[] {"Stone"}; + return new String[] { "Stone" }; case STRAW: - return new String[] {"Straw"}; + return new String[] { "Straw" }; case TALLOW: - return new String[] {"Tallow"}; + return new String[] { "Tallow" }; case THAUMIUM: - return new String[] {"Thaumium"}; + return new String[] { "Thaumium" }; case WOOD: - return new String[] {"Wood"}; + return new String[] { "Wood" }; default: throw new LuaException("Unknown Golem Type: " + golem.getGolemType()); } @@ -376,7 +365,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC @Callback(doc = "function():x:number,y:number,z:number -- Returns The golems current position") @Optional.Method(modid = "OpenComputers") public Object[] getPosition(Context context, Arguments args) { - return new Double[] {golem.posX, golem.posY, golem.posZ}; + return new Double[] { golem.posX, golem.posY, golem.posZ }; } @Callback(doc = "function():string -- Returns The golems type") @@ -388,7 +377,7 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC @Callback(doc = "function():number -- Returns The golems health") @Optional.Method(modid = "OpenComputers") public Object[] getHealth(Context context, Arguments args) throws LuaException { - return new Float[] {golem.getHealth()}; + return new Float[] { golem.getHealth() }; } @Callback(doc = "function():string -- Returns The golems core") @@ -407,7 +396,10 @@ public class TileGolemConnector extends TileCamo implements IPeripheral, SimpleC @Optional.Method(modid = "OpenComputers") public Object[] setHome(Context context, Arguments args) throws LuaException { return setHomeImplementation( - args.checkDouble(0), args.checkDouble(1), args.checkDouble(2), args.checkDouble(3)); + args.checkDouble(0), + args.checkDouble(1), + args.checkDouble(2), + args.checkDouble(3)); } @Callback(doc = "function():table -- Gets list of markers") diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedFarmland.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedFarmland.java index 79ea6316..ccb1503e 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedFarmland.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedFarmland.java @@ -1,11 +1,13 @@ package thaumic.tinkerer.common.block.tile; import java.util.Random; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; @@ -14,6 +16,7 @@ import thaumcraft.api.aspects.IAspectContainer; * Created by pixlepix on 8/4/14. */ public class TileInfusedFarmland extends TileEntity implements IAspectContainer { + public static final int MAX_ASPECTS = 20; public static final String NBT_ASPECT_LIST = "aspectList"; public AspectList aspectList = new AspectList(); diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedGrain.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedGrain.java index 138a09ae..761b02e3 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedGrain.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileInfusedGrain.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.block.tile; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; @@ -9,6 +10,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; @@ -37,12 +39,11 @@ public class TileInfusedGrain extends TileEntity implements IAspectContainer { if (!worldObj.isRemote && worldObj.getBlockLightValue(xCoord, yCoord + 1, zCoord) >= 9) { int l = worldObj.getBlockMetadata(xCoord, yCoord, zCoord); if (l < 7) { - if (worldObj.rand.nextInt((((2510 - - (int) Math.pow( - ((TileInfusedGrain) (worldObj.getTileEntity(xCoord, yCoord, zCoord))) - .primalTendencies.getAmount(Aspect.WATER), - 2))) - * 6)) + if (worldObj.rand.nextInt( + (((2510 - (int) Math.pow( + ((TileInfusedGrain) (worldObj.getTileEntity(xCoord, yCoord, zCoord))).primalTendencies + .getAmount(Aspect.WATER), + 2))) * 6)) == 0) { ++l; worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, l, 3); @@ -62,8 +63,8 @@ public class TileInfusedGrain extends TileEntity implements IAspectContainer { && !aspect.isPrimal()) { for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - TileEntity entity = - worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); + TileEntity entity = worldObj + .getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ); if (entity instanceof TileInfusedGrain) { // Exchange aspects TileInfusedGrain tileInfusedGrain = (TileInfusedGrain) entity; @@ -128,8 +129,8 @@ public class TileInfusedGrain extends TileEntity implements IAspectContainer { } @Override - public boolean shouldRefresh( - Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { + public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, + int z) { return !(oldBlock == newBlock); } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileMagnet.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileMagnet.java index 5797a953..ca004ac4 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileMagnet.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileMagnet.java @@ -1,53 +1,53 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:10:55 (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; -import cpw.mods.fml.common.Optional; -import dan200.computercraft.api.lua.ILuaContext; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; import java.util.List; + import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; + import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.codechicken.lib.vec.Vector3; import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.helper.MiscHelper; +import appeng.api.movable.IMovableTile; +import cpw.mods.fml.common.Optional; +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; -@Optional.InterfaceList({ - @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), - @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") -}) +@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), + @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") }) public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, SimpleComponent { @Override public void updateEntity() { int redstone = 0; - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - redstone = Math.max( - redstone, - worldObj.getIndirectPowerLevelTo( - xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal())); + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) redstone = Math.max( + redstone, + worldObj.getIndirectPowerLevelTo( + xCoord + dir.offsetX, + yCoord + dir.offsetY, + zCoord + dir.offsetZ, + dir.ordinal())); if (redstone > 0) { double x1 = xCoord + 0.5; @@ -58,8 +58,8 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, int speedMod = blue ? 1 : -1; double range = redstone / 2; - AxisAlignedBB boundingBox = - AxisAlignedBB.getBoundingBox(x1 - range, yCoord, z1 - range, x1 + range, y1 + range, z1 + range); + AxisAlignedBB boundingBox = AxisAlignedBB + .getBoundingBox(x1 - range, yCoord, z1 - range, x1 + range, y1 + range, z1 + range); List entities = worldObj.selectEntitiesWithinAABB(Entity.class, boundingBox, getEntitySelector()); for (Entity entity : entities) { @@ -67,8 +67,9 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, double y2 = entity.posY; double z2 = entity.posZ; - float distanceSqrd = - blue ? (float) ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)) : 1.1F; + float distanceSqrd = blue + ? (float) ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2)) + : 1.1F; if (distanceSqrd > 1) { MiscHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), speedMod * 0.25F); @@ -95,7 +96,7 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, @Override public String[] getMethodNames() { - return new String[] {"isPulling", "setPulling", "getSignal"}; + return new String[] { "isPulling", "setPulling", "getSignal" }; } @Override @@ -103,7 +104,7 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { switch (method) { case 0: - return new Object[] {(getBlockMetadata() & 1) == 0}; + return new Object[] { (getBlockMetadata() & 1) == 0 }; case 1: return setPullingImplementation((Boolean) arguments[0]); case 2: @@ -115,13 +116,15 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, private Object[] gotSignalImplementation() { int redstone = 0; - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - redstone = Math.max( - redstone, - worldObj.getIndirectPowerLevelTo( - xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir.ordinal())); + for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) redstone = Math.max( + redstone, + worldObj.getIndirectPowerLevelTo( + xCoord + dir.offsetX, + yCoord + dir.offsetY, + zCoord + dir.offsetZ, + dir.ordinal())); - return new Object[] {redstone}; + return new Object[] { redstone }; } private Object[] setPullingImplementation(boolean argument) { @@ -160,7 +163,7 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile, @Callback(doc = "function():boolean -- Returns Whether magnet is pushing or pulling") @Optional.Method(modid = "OpenComputers") public Object[] isPulling(Context context, Arguments args) throws Exception { - return new Object[] {(getBlockMetadata() & 1) == 0}; + return new Object[] { (getBlockMetadata() & 1) == 0 }; } @Callback(doc = "function(boolean):nil -- Sets Whether magnet is pushing or pulling") diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileMobMagnet.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileMobMagnet.java index 98f1ea99..c8a07bc5 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileMobMagnet.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileMobMagnet.java @@ -1,26 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:14:05 (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; -import cpw.mods.fml.common.Optional; -import dan200.computercraft.api.lua.ILuaContext; -import dan200.computercraft.api.peripheral.IComputerAccess; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; + import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; @@ -34,8 +28,13 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.network.NetworkManager; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraftforge.common.util.Constants; + import thaumic.tinkerer.common.item.ItemSoulMould; import thaumic.tinkerer.common.lib.LibBlockNames; +import appeng.api.movable.IMovableTile; +import cpw.mods.fml.common.Optional; +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.peripheral.IComputerAccess; public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTile { @@ -188,7 +187,7 @@ public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTil @Override public String[] getMethodNames() { - return new String[] {"isPulling", "setPulling", "getSignal", "getAdultSearch", "setAdultSearch"}; + return new String[] { "isPulling", "setPulling", "getSignal", "getAdultSearch", "setAdultSearch" }; } @Override @@ -196,7 +195,7 @@ public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTil public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { switch (method) { case 3: - return new Object[] {adult}; + return new Object[] { adult }; case 4: return setAdultSearchImplementation((Boolean) arguments[0]); } @@ -213,7 +212,7 @@ public class TileMobMagnet extends TileMagnet implements IInventory, IMovableTil @Callback(doc = "function():boolean -- Gets Whether magnet is searching for adults") @Optional.Method(modid = "OpenComputers") public Object[] getAdultSearch(Context context, Arguments args) throws Exception { - return new Object[] {adult}; + return new Object[] { adult }; } @Callback(doc = "function(boolean):nil -- Sets Whether magnet is searching for adults") diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileRPlacer.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileRPlacer.java index 98464580..4c243863 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileRPlacer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileRPlacer.java @@ -15,12 +15,14 @@ import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.FakePlayerFactory; import net.minecraftforge.common.util.ForgeDirection; + import thaumic.tinkerer.common.lib.LibBlockNames; /** * Created by nekosune on 30/06/14. */ public class TileRPlacer extends TileCamo implements IInventory { + private static final String TAG_ORIENTATION = "orientation"; private static final String TAG_BLOCKS = "blocks"; public int orientation; @@ -205,19 +207,26 @@ public class TileRPlacer extends TileCamo implements IInventory { if (this.worldObj.getBlock(x, y, z) == Blocks.air) { // if (this.worldObj.setBlock(x, y, z, ((ItemBlock) this.inventorySlots[0].getItem()).field_150939_a, // this.inventorySlots[0].getItemDamage(), 1 | 2)) { - // this.decrStackSize(0, 1); + // this.decrStackSize(0, 1); // markDirty(); // Block block = worldObj.getBlock(x, y, z); boolean done = false; FakePlayer player = FakePlayerFactory.getMinecraft((WorldServer) worldObj); Item item = inventorySlots[0].getItem(); ItemStack stack = inventorySlots[0]; - if (!done) - item.onItemUseFirst( - stack, player, worldObj, x, y, z, ForgeDirection.OPPOSITES[orientation], 0F, 0F, 0F); - if (!done) - done = item.onItemUse( - stack, player, worldObj, x, y, z, ForgeDirection.OPPOSITES[orientation], 0F, 0F, 0F); + if (!done) item.onItemUseFirst( + stack, + player, + worldObj, + x, + y, + z, + ForgeDirection.OPPOSITES[orientation], + 0F, + 0F, + 0F); + if (!done) done = item + .onItemUse(stack, player, worldObj, x, y, z, ForgeDirection.OPPOSITES[orientation], 0F, 0F, 0F); if (!done) { item.onItemRightClick(stack, worldObj, player); done = true; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileRepairer.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileRepairer.java index 816f6111..42920f6c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileRepairer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileRepairer.java @@ -1,23 +1,19 @@ /** - * x * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * x * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 30, 2013, 5:39:09 PM (GMT)] */ package thaumic.tinkerer.common.block.tile; -import appeng.api.movable.IMovableTile; -import cpw.mods.fml.common.Loader; import java.util.HashMap; import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -28,6 +24,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.Constants; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -37,8 +34,10 @@ import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.compat.TinkersConstructCompat; import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.lib.LibBlockNames; +import appeng.api.movable.IMovableTile; +import cpw.mods.fml.common.Loader; -/*import thaumic.tinkerer.common.compat.TinkersConstructCompat;*/ +/* import thaumic.tinkerer.common.compat.TinkersConstructCompat; */ public class TileRepairer extends TileEntity implements ISidedInventory, IAspectContainer, IEssentiaTransport, IMovableTile { @@ -76,8 +75,8 @@ public class TileRepairer extends TileEntity tookLastTick = true; } else tookLastTick = false; } else tookLastTick = false; - dmgLastTick = - inventorySlots[0] == null ? 0 : TinkersConstructCompat.getDamage(inventorySlots[0]); + dmgLastTick = inventorySlots[0] == null ? 0 + : TinkersConstructCompat.getDamage(inventorySlots[0]); return; } } @@ -231,7 +230,7 @@ public class TileRepairer extends TileEntity @Override public int[] getAccessibleSlotsFromSide(int var1) { - return new int[] {0}; + return new int[] { 0 }; } @Override @@ -256,10 +255,10 @@ public class TileRepairer extends TileEntity IEssentiaTransport ic = (IEssentiaTransport) te; if (!ic.canOutputTo(orientation.getOpposite())) return 0; - for (Aspect aspect : repairValues.keySet()) - if (ic.getSuctionType(orientation.getOpposite()) == aspect - && ic.getSuctionAmount(orientation.getOpposite()) < getSuctionAmount(orientation) - && ic.takeEssentia(aspect, 1, orientation.getOpposite()) == 1) return repairValues.get(aspect); + for (Aspect aspect : repairValues.keySet()) if (ic.getSuctionType(orientation.getOpposite()) == aspect + && ic.getSuctionAmount(orientation.getOpposite()) < getSuctionAmount(orientation) + && ic.takeEssentia(aspect, 1, orientation.getOpposite()) == 1) + return repairValues.get(aspect); } return 0; } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileSummon.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileSummon.java index 5c6cb5aa..85d3d482 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileSummon.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileSummon.java @@ -2,11 +2,13 @@ package thaumic.tinkerer.common.block.tile; import java.util.ArrayList; import java.util.Arrays; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.tileentity.TileEntity; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.tiles.TilePedestal; import thaumic.tinkerer.common.ThaumicTinkerer; @@ -27,8 +29,7 @@ public class TileSummon extends TileEntity { for (int x = xCoord - radius; x <= xCoord + radius; x++) { for (int z = zCoord - radius; z <= zCoord + radius; z++) { TileEntity tile = worldObj.getTileEntity(x, yCoord, z); - if (tile instanceof TilePedestal - && ((TilePedestal) tile).getStackInSlot(0) != null + if (tile instanceof TilePedestal && ((TilePedestal) tile).getStackInSlot(0) != null && ((TilePedestal) tile).getStackInSlot(0).getItem() instanceof ItemMobAspect) { pedestals.add(tile); } @@ -68,16 +69,14 @@ public class TileSummon extends TileEntity { ped3.setInventorySlotContents(0, null); } - if (!isInfused - || ItemMobAspect.lastUsedTabletMatches(ped1.getStackInSlot(0), this) - && ItemMobAspect.lastUsedTabletMatches( - ped2.getStackInSlot(0), this) - && ItemMobAspect.lastUsedTabletMatches( - ped3.getStackInSlot(0), this)) { + if (!isInfused || ItemMobAspect + .lastUsedTabletMatches(ped1.getStackInSlot(0), this) + && ItemMobAspect.lastUsedTabletMatches(ped2.getStackInSlot(0), this) + && ItemMobAspect.lastUsedTabletMatches(ped3.getStackInSlot(0), this)) { if (!worldObj.isRemote) { - Entity spawn = - EntityList.createEntityByName(recipe.toString(), worldObj); + Entity spawn = EntityList + .createEntityByName(recipe.toString(), worldObj); spawn.setLocationAndAngles(xCoord + .5, yCoord + 1, zCoord + .5, 0, 0); if (spawn instanceof EntitySkeleton && worldObj.provider.isHellWorld) { ((EntitySkeleton) spawn).setSkeletonType(1); diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/TileWardedSlab.java b/src/main/java/thaumic/tinkerer/common/block/tile/TileWardedSlab.java index 38955d76..bb913a8b 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/TileWardedSlab.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/TileWardedSlab.java @@ -2,17 +2,20 @@ package thaumic.tinkerer.common.block.tile; import java.util.Iterator; import java.util.List; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; + import thaumcraft.common.config.ConfigBlocks; /** * Created by Katrina on 14/04/2015. */ public class TileWardedSlab extends TileEntity { + int count = 0; public TileWardedSlab() {} @@ -35,13 +38,12 @@ public class TileWardedSlab extends TileEntity { List targets = this.worldObj.getEntitiesWithinAABB( EntityLivingBase.class, AxisAlignedBB.getBoundingBox( - (double) this.xCoord, - (double) this.yCoord - 1, - (double) this.zCoord, - (double) (this.xCoord + 1), - (double) (this.yCoord + 3), - (double) (this.zCoord + 1)) - .expand(0.1D, 0.1D, 0.1D)); + (double) this.xCoord, + (double) this.yCoord - 1, + (double) this.zCoord, + (double) (this.xCoord + 1), + (double) (this.yCoord + 3), + (double) (this.zCoord + 1)).expand(0.1D, 0.1D, 0.1D)); if (targets.size() > 0) { Iterator i$ = targets.iterator(); @@ -59,17 +61,15 @@ public class TileWardedSlab extends TileEntity { if (++this.count % 100 == 0) { if ((this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) != ConfigBlocks.blockAiry - || this.worldObj.getBlockMetadata(this.xCoord, this.yCoord + 1, this.zCoord) != 3) - && this.worldObj - .getBlock(this.xCoord, this.yCoord + 1, this.zCoord) + || this.worldObj.getBlockMetadata(this.xCoord, this.yCoord + 1, this.zCoord) != 3) + && this.worldObj.getBlock(this.xCoord, this.yCoord + 1, this.zCoord) .isReplaceable(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord)) { this.worldObj.setBlock(this.xCoord, this.yCoord + 1, this.zCoord, ConfigBlocks.blockAiry, 4, 3); } if ((this.worldObj.getBlock(this.xCoord, this.yCoord + 2, this.zCoord) != ConfigBlocks.blockAiry - || this.worldObj.getBlockMetadata(this.xCoord, this.yCoord + 2, this.zCoord) != 3) - && this.worldObj - .getBlock(this.xCoord, this.yCoord + 2, this.zCoord) + || this.worldObj.getBlockMetadata(this.xCoord, this.yCoord + 2, this.zCoord) != 3) + && this.worldObj.getBlock(this.xCoord, this.yCoord + 2, this.zCoord) .isReplaceable(this.worldObj, this.xCoord, this.yCoord + 2, this.zCoord)) { this.worldObj.setBlock(this.xCoord, this.yCoord + 2, this.zCoord, ConfigBlocks.blockAiry, 4, 3); } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAnimationTablet.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAnimationTablet.java index cb211af0..e9e97c33 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAnimationTablet.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAnimationTablet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:26:46 (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet; public class ContainerAnimationTablet extends ContainerPlayerInv { diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAspectAnalyzer.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAspectAnalyzer.java index 5c253cb5..9d9d53fd 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAspectAnalyzer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerAspectAnalyzer.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 10:42:23 PM (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumcraft.common.container.SlotLimitedHasAspects; import thaumic.tinkerer.common.block.tile.TileAspectAnalyzer; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerEnchanter.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerEnchanter.java index 6163322e..2b69ea87 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerEnchanter.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerEnchanter.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 18:10:21 (GMT)] @@ -19,6 +16,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.block.tile.TileEnchanter; import thaumic.tinkerer.common.block.tile.container.slot.SlotTool; import thaumic.tinkerer.common.block.tile.container.slot.SlotWand; @@ -49,14 +47,14 @@ public class ContainerEnchanter extends ContainerPlayerInv { boolean wand = ((Slot) inventorySlots.get(1)).isItemValid(var5); - //noinspection ConstantConditions + // noinspection ConstantConditions var3 = var5.copy(); if (par2 < 2) { if (!mergeItemStack(var5, 2, 38, false)) return null; - } else if (wand - ? !mergeItemStack(var5, 1, 2, false) - : var5.getItem().isItemTool(var5) && !mergeItemStack(var5, 0, 1, false)) return null; + } else if (wand ? !mergeItemStack(var5, 1, 2, false) + : var5.getItem().isItemTool(var5) && !mergeItemStack(var5, 0, 1, false)) + return null; if (var5.stackSize == 0) var4.putStack(null); else var4.onSlotChanged(); diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerMobMagnet.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerMobMagnet.java index 644083ce..44d3ce9c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerMobMagnet.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerMobMagnet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:42:28 (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.block.tile.TileMobMagnet; import thaumic.tinkerer.common.block.tile.container.slot.SlotMobMagnet; import thaumic.tinkerer.common.item.ItemSoulMould; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerPlayerInv.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerPlayerInv.java index 80a462e8..1b5ef961 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerPlayerInv.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerPlayerInv.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:27:10 (GMT)] @@ -30,9 +27,8 @@ public abstract class ContainerPlayerInv extends Container { int ys = getInvYStart(); int xs = getInvXStart(); - for (int x = 0; x < 3; ++x) - for (int y = 0; y < 9; ++y) - addSlotToContainer(new Slot(playerInv, y + x * 9 + 9, xs + y * 18, ys + x * 18)); + for (int x = 0; x < 3; ++x) for (int y = 0; y < 9; ++y) + addSlotToContainer(new Slot(playerInv, y + x * 9 + 9, xs + y * 18, ys + x * 18)); for (int x = 0; x < 9; ++x) addSlotToContainer(new Slot(playerInv, x, xs + x * 18, ys + 58)); } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerRemotePlacer.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerRemotePlacer.java index a6be15a3..520f161f 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerRemotePlacer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/ContainerRemotePlacer.java @@ -4,12 +4,14 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.block.tile.TileRPlacer; /** * Created by nekosune on 30/06/14. */ public class ContainerRemotePlacer extends ContainerPlayerInv { + public TileRPlacer placer; public ContainerRemotePlacer(TileRPlacer placer, InventoryPlayer playerInv) { diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerIchorPouch.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerIchorPouch.java index 2fe19883..ce0f6911 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerIchorPouch.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerIchorPouch.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 10:37:08 PM (GMT)] @@ -19,6 +16,7 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumcraft.common.container.InventoryFocusPouch; import thaumcraft.common.items.wands.ItemFocusPouch; import thaumic.tinkerer.common.block.tile.container.ContainerPlayerInv; @@ -38,16 +36,13 @@ public class ContainerIchorPouch extends ContainerPlayerInv { pouch = player.getCurrentEquippedItem(); blockSlot = player.inventory.currentItem + 27 + 13 * 9; - for (int y = 0; y < 9; y++) - for (int x = 0; x < 13; x++) - addSlotToContainer(new SlotNoPouches(inv, y * 13 + x, 12 + x * 18, 8 + y * 18)); + for (int y = 0; y < 9; y++) for (int x = 0; x < 13; x++) + addSlotToContainer(new SlotNoPouches(inv, y * 13 + x, 12 + x * 18, 8 + y * 18)); initPlayerInv(); - if (!player.worldObj.isRemote) - try { - ((InventoryIchorPouch) inv).stackList = ((ItemFocusPouch) pouch.getItem()).getInventory(pouch); - } catch (Exception e) { - } + if (!player.worldObj.isRemote) try { + ((InventoryIchorPouch) inv).stackList = ((ItemFocusPouch) pouch.getItem()).getInventory(pouch); + } catch (Exception e) {} } @Override @@ -61,7 +56,8 @@ public class ContainerIchorPouch extends ContainerPlayerInv { stack = stackInSlot.copy(); if (slot < 13 * 9) { if (!inv.isItemValidForSlot(slot, stackInSlot) - || !mergeItemStack(stackInSlot, 13 * 9, inventorySlots.size(), true)) return null; + || !mergeItemStack(stackInSlot, 13 * 9, inventorySlots.size(), true)) + return null; } else if (!inv.isItemValidForSlot(slot, stackInSlot) || !mergeItemStack(stackInSlot, 0, 13 * 9, false)) { return null; } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerWarpGate.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerWarpGate.java index f5cb9221..7fce10d6 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerWarpGate.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/kami/ContainerWarpGate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 5:45:28 PM (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.tile.container.ContainerPlayerInv; import thaumic.tinkerer.common.block.tile.container.slot.kami.SlotSkyPearl; @@ -57,7 +55,8 @@ public class ContainerWarpGate extends ContainerPlayerInv { if (par2 < 10) { if (!mergeItemStack(var5, 10, 36, false)) return null; } else if (var3.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class) - && !mergeItemStack(var5, 0, 10, false)) return null; + && !mergeItemStack(var5, 0, 10, false)) + return null; if (var5.stackSize == 0) var4.putStack(null); else var4.onSlotChanged(); diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotMobMagnet.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotMobMagnet.java index da94da9d..4ff72485 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotMobMagnet.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotMobMagnet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:43:26 (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.block.tile.container.slot; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.block.tile.TileMobMagnet; import thaumic.tinkerer.common.item.ItemSoulMould; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotResearchTableOverride.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotResearchTableOverride.java index 6d5d321d..87887773 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotResearchTableOverride.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotResearchTableOverride.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 30, 2013, 11:03:09 PM (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.block.tile.container.slot; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumcraft.common.items.ItemInkwell; import thaumic.tinkerer.common.item.ItemInfusedInkwell; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotTool.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotTool.java index 45f2ea9e..45fa3f0c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotTool.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotTool.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 18:35:37 (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.block.tile.TileEnchanter; public class SlotTool extends Slot { @@ -31,8 +29,7 @@ public class SlotTool extends Slot { @Override public boolean isItemValid(ItemStack par1ItemStack) { - return !enchanter.working - && par1ItemStack.getItem() != Items.book + return !enchanter.working && par1ItemStack.getItem() != Items.book && par1ItemStack.getItem().isItemTool(par1ItemStack); } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotWand.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotWand.java index 8cc4a18d..8e44baf2 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotWand.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/SlotWand.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 18:35:49 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.block.tile.container.slot; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumcraft.common.items.wands.ItemWandCasting; public class SlotWand extends Slot { @@ -28,7 +26,8 @@ public class SlotWand extends Slot { @Override public boolean isItemValid(ItemStack par1ItemStack) { if (!(par1ItemStack.getItem() instanceof ItemWandCasting) - || ((ItemWandCasting) par1ItemStack.getItem()).isStaff(par1ItemStack)) return false; + || ((ItemWandCasting) par1ItemStack.getItem()).isStaff(par1ItemStack)) + return false; ItemWandCasting wand = (ItemWandCasting) par1ItemStack.getItem(); return wand.getCap(par1ItemStack).getBaseCostModifier() <= 1F; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotNoPouches.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotNoPouches.java index 6de3ba2f..7001f5a5 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotNoPouches.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotNoPouches.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 11:12:29 PM (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import thaumcraft.common.items.wands.ItemFocusPouch; public class SlotNoPouches extends Slot { diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotSkyPearl.java b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotSkyPearl.java index 656bf89c..3fca9821 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotSkyPearl.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/container/slot/kami/SlotSkyPearl.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 5:51:20 PM (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.block.tile.container.slot.kami; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.item.kami.ItemSkyPearl; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileBedrockPortal.java b/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileBedrockPortal.java index fa6af3b2..880aebe5 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileBedrockPortal.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileBedrockPortal.java @@ -3,6 +3,7 @@ package thaumic.tinkerer.common.block.tile.kami; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; + import thaumic.tinkerer.common.core.handler.ConfigHandler; public class TileBedrockPortal extends TileEntity { diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileWarpGate.java b/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileWarpGate.java index 53875ba6..d18658d9 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileWarpGate.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/kami/TileWarpGate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 3:56:13 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.block.tile.kami; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.IInventory; @@ -28,6 +26,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.ChunkCoordinates; import net.minecraftforge.common.util.Constants; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.item.kami.ItemSkyPearl; import thaumic.tinkerer.common.lib.LibBlockNames; @@ -52,30 +51,26 @@ public class TileWarpGate extends TileEntity implements IInventory { if (!destGate.locked) { player.worldObj.playSoundAtEntity(player, "thaumcraft:wand", 1F, 1F); - for (int i = 0; i < 20; i++) - ThaumicTinkerer.tcProxy.sparkle( - (float) player.posX + player.worldObj.rand.nextFloat() - 0.5F, - (float) player.posY + player.worldObj.rand.nextFloat(), - (float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F, - 6); + for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle( + (float) player.posX + player.worldObj.rand.nextFloat() - 0.5F, + (float) player.posY + player.worldObj.rand.nextFloat(), + (float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F, + 6); player.mountEntity(null); - if (player instanceof EntityPlayerMP) - ((EntityPlayerMP) player) - .playerNetServerHandler.setPlayerLocation( - x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch); + if (player instanceof EntityPlayerMP) ((EntityPlayerMP) player).playerNetServerHandler + .setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch); - for (int i = 0; i < 20; i++) - ThaumicTinkerer.tcProxy.sparkle( - (float) player.posX + player.worldObj.rand.nextFloat() - 0.5F, - (float) player.posY + player.worldObj.rand.nextFloat(), - (float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F, - 6); + for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle( + (float) player.posX + player.worldObj.rand.nextFloat() - 0.5F, + (float) player.posY + player.worldObj.rand.nextFloat(), + (float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F, + 6); player.worldObj.playSoundAtEntity(player, "thaumcraft:wand", 1F, 0.1F); return true; - } else if (!player.worldObj.isRemote) - player.addChatMessage(new ChatComponentTranslation("ttmisc.noTeleport")); + } else + if (!player.worldObj.isRemote) player.addChatMessage(new ChatComponentTranslation("ttmisc.noTeleport")); } else if (!player.worldObj.isRemote) player.addChatMessage(new ChatComponentTranslation("ttmisc.noDest")); return false; @@ -88,17 +83,16 @@ public class TileWarpGate extends TileEntity implements IInventory { AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 1.5, zCoord + 1)); EntityPlayer clientPlayer = ThaumicTinkerer.proxy.getClientPlayer(); - for (EntityPlayer player : players) - if (player != null && player == clientPlayer && player.isSneaking()) { - player.openGui( - ThaumicTinkerer.instance, - LibGuiIDs.GUI_ID_WARP_GATE_DESTINATIONS, - worldObj, - xCoord, - yCoord, - zCoord); - break; - } + for (EntityPlayer player : players) if (player != null && player == clientPlayer && player.isSneaking()) { + player.openGui( + ThaumicTinkerer.instance, + LibGuiIDs.GUI_ID_WARP_GATE_DESTINATIONS, + worldObj, + xCoord, + yCoord, + zCoord); + break; + } teleportedThisTick = false; } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TabletFakePlayer.java b/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TabletFakePlayer.java index dc810099..8bda9036 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TabletFakePlayer.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TabletFakePlayer.java @@ -1,27 +1,27 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 15:54:36 (GMT)] */ package thaumic.tinkerer.common.block.tile.tablet; -import com.mojang.authlib.GameProfile; import java.util.UUID; + import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.IChatComponent; import net.minecraft.world.World; + import thaumcraft.common.lib.FakeThaumcraftPlayer; +import com.mojang.authlib.GameProfile; + public class TabletFakePlayer extends FakeThaumcraftPlayer { TileAnimationTablet tablet; diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TileAnimationTablet.java b/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TileAnimationTablet.java index bf3a4665..8aed231b 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TileAnimationTablet.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/tablet/TileAnimationTablet.java @@ -1,32 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 15:51:34 (GMT)] */ package thaumic.tinkerer.common.block.tile.tablet; -import appeng.api.movable.IMovableTile; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.eventhandler.Event; -import dan200.computercraft.api.lua.ILuaContext; -import dan200.computercraft.api.lua.LuaException; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; import java.util.ArrayList; import java.util.List; + import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.SimpleComponent; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -51,14 +43,20 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockAnimationTablet; import thaumic.tinkerer.common.lib.LibBlockNames; +import appeng.api.movable.IMovableTile; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.eventhandler.Event; +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; -@Optional.InterfaceList({ - @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), - @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") -}) +@Optional.InterfaceList({ @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"), + @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft") }) public class TileAnimationTablet extends TileEntity implements IInventory, IMovableTile, IPeripheral, SimpleComponent { private static final String TAG_LEFT_CLICK = "leftClick"; @@ -67,15 +65,10 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova private static final String TAG_MOD = "mod"; private static final String TAG_OWNER = "owner"; - private static final int[][] LOC_INCREASES = new int[][] { - {0, -1}, - {0, +1}, - {-1, 0}, - {+1, 0} - }; + private static final int[][] LOC_INCREASES = new int[][] { { 0, -1 }, { 0, +1 }, { -1, 0 }, { +1, 0 } }; - private static final ForgeDirection[] SIDES = - new ForgeDirection[] {ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.WEST, ForgeDirection.EAST}; + private static final ForgeDirection[] SIDES = new ForgeDirection[] { ForgeDirection.NORTH, ForgeDirection.SOUTH, + ForgeDirection.WEST, ForgeDirection.EAST }; private static final int SWING_SPEED = 3; private static final int MAX_DEGREE = 45; @@ -153,16 +146,14 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova boolean done = false; if (leftClick) { - Entity entity = detectedEntities.isEmpty() - ? null + Entity entity = detectedEntities.isEmpty() ? null : detectedEntities.get(worldObj.rand.nextInt(detectedEntities.size())); if (entity != null) { player.getAttributeMap().applyAttributeModifiers(stack.getAttributeModifiers()); // Set attack strenght player.attackTargetEntityWithCurrentItem(entity); done = true; } else if (!isBreaking) { - if (block != Blocks.air - && !block.isAir(worldObj, coords.posX, coords.posY, coords.posZ) + if (block != Blocks.air && !block.isAir(worldObj, coords.posX, coords.posY, coords.posZ) && block.getBlockHardness(worldObj, coords.posX, coords.posY, coords.posZ) >= 0) { isBreaking = true; startBreaking(block, worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ)); @@ -180,25 +171,34 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova try { ForgeEventFactory.onPlayerInteract( - player, Action.RIGHT_CLICK_AIR, coords.posX, coords.posY, coords.posZ, side, worldObj); - Entity entity = detectedEntities.isEmpty() - ? null + player, + Action.RIGHT_CLICK_AIR, + coords.posX, + coords.posY, + coords.posZ, + side, + worldObj); + Entity entity = detectedEntities.isEmpty() ? null : detectedEntities.get(worldObj.rand.nextInt(detectedEntities.size())); - done = entity != null - && entity instanceof EntityLiving + done = entity != null && entity instanceof EntityLiving && (item.itemInteractionForEntity(stack, player, (EntityLivingBase) entity) || (!(entity instanceof EntityAnimal) || ((EntityAnimal) entity).interact(player))); - if (!done) - item.onItemUseFirst( - stack, player, worldObj, coords.posX, coords.posY, coords.posZ, side, 0F, 0F, 0F); - if (!done) - done = block != null - && block.onBlockActivated( - worldObj, coords.posX, coords.posY, coords.posZ, player, side, 0F, 0F, 0F); - if (!done) - done = item.onItemUse( - stack, player, worldObj, coords.posX, coords.posY, coords.posZ, side, 0F, 0F, 0F); + if (!done) item.onItemUseFirst( + stack, + player, + worldObj, + coords.posX, + coords.posY, + coords.posZ, + side, + 0F, + 0F, + 0F); + if (!done) done = block != null && block + .onBlockActivated(worldObj, coords.posX, coords.posY, coords.posZ, player, side, 0F, 0F, 0F); + if (!done) done = item + .onItemUse(stack, player, worldObj, coords.posX, coords.posY, coords.posZ, side, 0F, 0F, 0F); if (!done) { item.onItemRightClick(stack, worldObj, player); done = true; @@ -209,13 +209,19 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova List list = worldObj.getEntitiesWithinAABB( EntityPlayer.class, AxisAlignedBB.getBoundingBox( - xCoord - 8, yCoord - 8, zCoord - 8, xCoord + 8, yCoord + 8, zCoord + 8)); + xCoord - 8, + yCoord - 8, + zCoord - 8, + xCoord + 8, + yCoord + 8, + zCoord + 8)); for (Object player : list) { - ((EntityPlayer) player) - .addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED - + "Something went wrong with a Tool Dynamism Tablet! Check your FML log.")); - ((EntityPlayer) player) - .addChatComponentMessage(new ChatComponentText( + ((EntityPlayer) player).addChatComponentMessage( + new ChatComponentText( + EnumChatFormatting.RED + + "Something went wrong with a Tool Dynamism Tablet! Check your FML log.")); + ((EntityPlayer) player).addChatComponentMessage( + new ChatComponentText( EnumChatFormatting.RED + "" + EnumChatFormatting.ITALIC + e.getMessage())); } } @@ -243,7 +249,13 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova ChunkCoordinates coords = getTargetLoc(); PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract( - player, Action.LEFT_CLICK_BLOCK, coords.posX, coords.posY, coords.posZ, side, worldObj); + player, + Action.LEFT_CLICK_BLOCK, + coords.posX, + coords.posY, + coords.posZ, + side, + worldObj); if (event.isCanceled()) { stopBreaking(); return; @@ -291,7 +303,11 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova if (var5 != durabilityRemainingOnBlock) { worldObj.destroyBlockInWorldPartially( - player.getEntityId(), coords.posX, coords.posY, coords.posZ, var5); + player.getEntityId(), + coords.posX, + coords.posY, + coords.posZ, + var5); durabilityRemainingOnBlock = var5; } @@ -346,7 +362,12 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova public void findEntities(ChunkCoordinates coords) { AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox( - coords.posX, coords.posY, coords.posZ, coords.posX + 1, coords.posY + 1, coords.posZ + 1); + coords.posX, + coords.posY, + coords.posZ, + coords.posX + 1, + coords.posY + 1, + coords.posZ + 1); detectedEntities = worldObj.getEntitiesWithinAABB(Entity.class, boundingBox); } @@ -361,8 +382,8 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova int meta = getBlockMetadata(); if (meta == 0) { - ThaumicTinkerer.log.error( - "Metadata of a Tool Dynamism tablet is in an invalid state. This is a critical error."); + ThaumicTinkerer.log + .error("Metadata of a Tool Dynamism tablet is in an invalid state. This is a critical error."); return coords; } int[] increase = LOC_INCREASES[(meta & 7) - 2]; @@ -393,9 +414,9 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova swingProgress = par1NBTTagCompound.getInteger(TAG_PROGRESS); // if(par1NBTTagCompound.hasKey(TAG_OWNER)) - // Owner=par1NBTTagCompound.getString(TAG_OWNER); + // Owner=par1NBTTagCompound.getString(TAG_OWNER); // else - // Owner=""; + // Owner=""; readCustomNBT(par1NBTTagCompound); } @@ -413,13 +434,13 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova leftClick = par1NBTTagCompound.getBoolean(TAG_LEFT_CLICK); redstone = par1NBTTagCompound.getBoolean(TAG_REDSTONE); // if(par1NBTTagCompound.hasKey("isBreaking")) - // isBreaking = par1NBTTagCompound.getBoolean("isBreaking"); + // isBreaking = par1NBTTagCompound.getBoolean("isBreaking"); // if(par1NBTTagCompound.hasKey("initialDamage")) - // initialDamage = par1NBTTagCompound.getInteger("initialDamage"); + // initialDamage = par1NBTTagCompound.getInteger("initialDamage"); // if(par1NBTTagCompound.hasKey("curblockDamage")) // curblockDamage = par1NBTTagCompound.getInteger("curblockDamage"); // if(par1NBTTagCompound.hasKey("durabilityRemainingOnBlock")) - // durabilityRemainingOnBlock=par1NBTTagCompound.getInteger("durabilityRemainingOnBlock"); + // durabilityRemainingOnBlock=par1NBTTagCompound.getInteger("durabilityRemainingOnBlock"); NBTTagList var2 = par1NBTTagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND); inventorySlots = new ItemStack[getSizeInventory()]; for (int var3 = 0; var3 < var2.tagCount(); ++var3) { @@ -548,16 +569,8 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova @Override public String[] getMethodNames() { - return new String[] { - "getRedstone", - "setRedstone", - "getLeftClick", - "setLeftClick", - "getRotation", - "setRotation", - "hasItem", - "trigger" - }; + return new String[] { "getRedstone", "setRedstone", "getLeftClick", "setLeftClick", "getRotation", + "setRotation", "hasItem", "trigger" }; } @Override @@ -566,19 +579,19 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova throws LuaException { switch (method) { case 0: - return new Object[] {redstone}; + return new Object[] { redstone }; case 1: return setRedstoneImplementation((Boolean) arguments[0]); case 2: - return new Object[] {leftClick}; + return new Object[] { leftClick }; case 3: return setLeftClickImplementation((Boolean) arguments[0]); case 4: - return new Object[] {getBlockMetadata() - 2}; + return new Object[] { getBlockMetadata() - 2 }; case 5: return setRotationImplementation((Double) arguments[0]); case 6: - return new Object[] {getStackInSlot(0) != null}; + return new Object[] { getStackInSlot(0) != null }; case 7: return triggerImplementation(); } @@ -586,7 +599,7 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova } private Object[] triggerImplementation() { - if (swingProgress != 0) return new Object[] {false}; + if (swingProgress != 0) return new Object[] { false }; findEntities(getTargetLoc()); initiateSwing(); @@ -598,7 +611,7 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova 0, 0); - return new Object[] {true}; + return new Object[] { true }; } @Optional.Method(modid = "ComputerCraft") @@ -658,47 +671,47 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova @Callback(doc = "function():boolean -- Returns Whether tablet is redstone activated") @Optional.Method(modid = "OpenComputers") public Object[] getRedstone(Context context, Arguments args) throws Exception { - return new Object[] {redstone}; + return new Object[] { redstone }; } @Callback(doc = "function(boolean):Nil -- Sets Whether tablet is redstone activated") @Optional.Method(modid = "OpenComputers") public Object[] setRedstone(Context context, Arguments args) throws Exception { setRedstoneImplementation(args.checkBoolean(0)); - return new Object[] {redstone}; + return new Object[] { redstone }; } @Callback(doc = "function():boolean -- Returns Whether tablet Left clicks") @Optional.Method(modid = "OpenComputers") public Object[] getLeftClick(Context context, Arguments args) throws Exception { - return new Object[] {leftClick}; + return new Object[] { leftClick }; } @Callback(doc = "function(boolean):Nil -- Sets Whether tablet Left Clicks") @Optional.Method(modid = "OpenComputers") public Object[] setLeftClick(Context context, Arguments args) throws Exception { setLeftClickImplementation(args.checkBoolean(0)); - return new Object[] {leftClick}; + return new Object[] { leftClick }; } // TODO {"hasItem", "trigger" }; @Callback(doc = "function():number -- Returns tablet Rotation") @Optional.Method(modid = "OpenComputers") public Object[] getRotation(Context context, Arguments args) throws Exception { - return new Object[] {getBlockMetadata() - 2}; + return new Object[] { getBlockMetadata() - 2 }; } @Callback(doc = "function(number):Nil -- Sets tablet rotation") @Optional.Method(modid = "OpenComputers") public Object[] setRotation(Context context, Arguments args) throws Exception { setRotationImplementation((double) args.checkInteger(0)); - return new Object[] {getBlockMetadata() - 2}; + return new Object[] { getBlockMetadata() - 2 }; } @Callback(doc = "function():boolean -- Returns wether tablet has an item or not") @Optional.Method(modid = "OpenComputers") public Object[] hasItem(Context context, Arguments args) throws Exception { - return new Object[] {getStackInSlot(0) != null}; + return new Object[] { getStackInSlot(0) != null }; } @Callback(doc = "function():Nil -- Triggers tablets swing") diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvector.java b/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvector.java index 09a8bdcb..dd5eaae2 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvector.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvector.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 24, 2013, 6:40:49 PM (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.block.tile.transvector; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; + import thaumic.tinkerer.common.block.tile.TileCamo; public abstract class TileTransvector extends TileCamo { @@ -59,10 +57,8 @@ public abstract class TileTransvector extends TileCamo { TileEntity tile = worldObj.getTileEntity(x, y, z); if (tile == null && tileRequiredAtLink() - || (Math.abs(x - xCoord) > getMaxDistance() - || Math.abs(y - yCoord) > getMaxDistance() - || Math.abs(z - zCoord) > getMaxDistance()) - && !cheaty) { + || (Math.abs(x - xCoord) > getMaxDistance() || Math.abs(y - yCoord) > getMaxDistance() + || Math.abs(z - zCoord) > getMaxDistance()) && !cheaty) { y = -1; return null; } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorDislocator.java b/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorDislocator.java index f1b1b7f3..8defbb0a 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorDislocator.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorDislocator.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 24, 2013, 6:48:04 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.block.tile.transvector; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; @@ -24,6 +22,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.codechicken.lib.vec.Vector3; import thaumcraft.common.config.ConfigBlocks; @@ -92,10 +91,9 @@ public class TileTransvectorDislocator extends TileTransvector { Block block = worldObj.getBlock(coords.posX, coords.posY, coords.posZ); int meta = worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ); - return !(block == ConfigBlocks.blockAiry && meta == 0) - && !ThaumcraftApi.portableHoleBlackList.contains(block) - && block != null - && block.getBlockHardness(worldObj, coords.posX, coords.posY, coords.posZ) != -1F + return !(block == ConfigBlocks.blockAiry && meta == 0) && !ThaumcraftApi.portableHoleBlackList.contains(block) + && block != null + && block.getBlockHardness(worldObj, coords.posX, coords.posY, coords.posZ) != -1F || block != Blocks.air; } @@ -103,7 +101,12 @@ public class TileTransvectorDislocator extends TileTransvector { return worldObj.getEntitiesWithinAABB( Entity.class, AxisAlignedBB.getBoundingBox( - coords.posX, coords.posY, coords.posZ, coords.posX + 1, coords.posY + 1, coords.posZ + 1)); + coords.posX, + coords.posY, + coords.posZ, + coords.posX + 1, + coords.posY + 1, + coords.posZ + 1)); } private Vector3 asVector(ChunkCoordinates source, ChunkCoordinates target) { @@ -168,8 +171,7 @@ public class TileTransvectorDislocator extends TileTransvector { NBTTagCompound cmp = new NBTTagCompound(); tile.writeToNBT(cmp); this.tile = cmp; - } - ; + } ; this.coords = coords; } @@ -204,7 +206,7 @@ public class TileTransvectorDislocator extends TileTransvector { } // if (block != null) - // block.onNeighborBlockChange(worldObj, coords.posX, coords.posY, coords.posZ, + // block.onNeighborBlockChange(worldObj, coords.posX, coords.posY, coords.posZ, // ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorDislocator.class)); worldObj.setBlockMetadataWithNotify(coords.posX, coords.posY, coords.posZ, meta, 2); @@ -212,13 +214,12 @@ public class TileTransvectorDislocator extends TileTransvector { public void notify(ChunkCoordinates coords) { - if (block != null) - block.onNeighborBlockChange( - worldObj, - coords.posX, - coords.posY, - coords.posZ, - ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorDislocator.class)); + if (block != null) block.onNeighborBlockChange( + worldObj, + coords.posX, + coords.posY, + coords.posZ, + ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorDislocator.class)); } } } diff --git a/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorInterface.java b/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorInterface.java index 18edd28c..f2ba4d0c 100644 --- a/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorInterface.java +++ b/src/main/java/thaumic/tinkerer/common/block/tile/transvector/TileTransvectorInterface.java @@ -1,29 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 19:01:20 (GMT)] */ package thaumic.tinkerer.common.block.tile.transvector; -import cofh.api.energy.IEnergyHandler; -import cofh.api.energy.IEnergyProvider; -import cofh.api.energy.IEnergyReceiver; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Optional; -import dan200.computercraft.api.lua.ILuaContext; -import dan200.computercraft.api.lua.LuaException; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; -import ic2.api.energy.tile.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; @@ -34,36 +21,36 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.aspects.IEssentiaTransport; import thaumic.tinkerer.common.compat.IndustrialcraftUnloadHelper; import thaumic.tinkerer.common.lib.LibFeatures; +import cofh.api.energy.IEnergyHandler; +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Optional; +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import ic2.api.energy.tile.*; @Optional.InterfaceList({ - @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft"), - @Optional.Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), - @Optional.Interface(iface = "cofh.api.energy.IEnergyReceiver", modid = "CoFHCore"), - @Optional.Interface(iface = "cofh.api.energy.IEnergyProvider", modid = "CoFHCore"), - @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), - @Optional.Interface(iface = "ic2.api.energy.tile.IEnergyEmitter", modid = "IC2"), - @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), - @Optional.Interface(iface = "ic2.api.energy.tile.IEnergyConductor", modid = "IC2") -}) + @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft"), + @Optional.Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "CoFHCore"), + @Optional.Interface(iface = "cofh.api.energy.IEnergyReceiver", modid = "CoFHCore"), + @Optional.Interface(iface = "cofh.api.energy.IEnergyProvider", modid = "CoFHCore"), + @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"), + @Optional.Interface(iface = "ic2.api.energy.tile.IEnergyEmitter", modid = "IC2"), + @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2"), + @Optional.Interface(iface = "ic2.api.energy.tile.IEnergyConductor", modid = "IC2") }) public class TileTransvectorInterface extends TileTransvector - implements ISidedInventory, - IEnergyEmitter, - IEnergySink, - IEnergyConductor, - IEnergySource, - IFluidHandler, - IEnergyHandler, - IEnergyReceiver, - IAspectContainer, - IEssentiaTransport, - IPeripheral, - IEnergyProvider { + implements ISidedInventory, IEnergyEmitter, IEnergySink, IEnergyConductor, IEnergySource, IFluidHandler, + IEnergyHandler, IEnergyReceiver, IAspectContainer, IEssentiaTransport, IPeripheral, IEnergyProvider { public boolean addedToICEnergyNet = false; @@ -225,24 +212,21 @@ public class TileTransvectorInterface extends TileTransvector @Override public int[] getAccessibleSlotsFromSide(int var1) { TileEntity tile = getTile(); - return tile instanceof ISidedInventory - ? ((ISidedInventory) tile).getAccessibleSlotsFromSide(var1) + return tile instanceof ISidedInventory ? ((ISidedInventory) tile).getAccessibleSlotsFromSide(var1) : tile instanceof IInventory ? buildSlotsForLinearInventory((IInventory) tile) : new int[0]; } @Override public boolean canInsertItem(int i, ItemStack itemstack, int j) { TileEntity tile = getTile(); - return tile instanceof ISidedInventory - ? ((ISidedInventory) tile).canInsertItem(i, itemstack, j) + return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canInsertItem(i, itemstack, j) : tile instanceof IInventory; } @Override public boolean canExtractItem(int i, ItemStack itemstack, int j) { TileEntity tile = getTile(); - return tile instanceof ISidedInventory - ? ((ISidedInventory) tile).canExtractItem(i, itemstack, j) + return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canExtractItem(i, itemstack, j) : tile instanceof IInventory; } @@ -420,8 +404,7 @@ public class TileTransvectorInterface extends TileTransvector @Override public int addEssentia(Aspect arg0, int arg1, ForgeDirection forgeDirection) { TileEntity tile = getTile(); - return tile instanceof IEssentiaTransport - ? ((IEssentiaTransport) tile).addEssentia(arg0, arg1, forgeDirection) + return tile instanceof IEssentiaTransport ? ((IEssentiaTransport) tile).addEssentia(arg0, arg1, forgeDirection) : 0; } @@ -441,8 +424,7 @@ public class TileTransvectorInterface extends TileTransvector @Override @Optional.Method(modid = "ComputerCraft") public String getType() { - return getTile() instanceof IPeripheral - ? ((IPeripheral) getTile()).getType() + return getTile() instanceof IPeripheral ? ((IPeripheral) getTile()).getType() : "Transvector Interface Unconnected Peripherad"; } diff --git a/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorDislocator.java b/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorDislocator.java index 261ec853..3860b680 100644 --- a/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorDislocator.java +++ b/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorDislocator.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 24, 2013, 10:08:39 PM (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.block.transvector; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockPistonBase; import net.minecraft.block.material.Material; @@ -28,6 +26,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -57,16 +56,8 @@ public class BlockTransvectorDislocator extends BlockCamo { } @Override - public boolean onBlockActivated( - World par1World, - int par2, - int par3, - int par4, - EntityPlayer par5EntityPlayer, - int par6, - float par7, - float par8, - float par9) { + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, + int par6, float par7, float par8, float par9) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); TileTransvectorDislocator dislocator = (TileTransvectorDislocator) tile; @@ -130,16 +121,11 @@ public class BlockTransvectorDislocator extends BlockCamo { } @Override - public void onBlockPlacedBy( - World par1World, - int par2, - int par3, - int par4, - EntityLivingBase par5EntityLivingBase, + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { TileEntity tile = par1World.getTileEntity(par2, par3, par4); - ((TileTransvectorDislocator) tile).orientation = - BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); + ((TileTransvectorDislocator) tile).orientation = BlockPistonBase + .determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); par1World.markBlockForUpdate(par2, par3, par4); } @@ -185,20 +171,14 @@ public class BlockTransvectorDislocator extends BlockCamo { } return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_DISLOCATOR, - new AspectList() - .add(Aspect.TRAVEL, 2) - .add(Aspect.MECHANISM, 1) - .add(Aspect.ELDRITCH, 1), - -6, - 1, - 3, - new ItemStack(this)) - .setConcealed() - .setParents(LibResearch.KEY_INTERFACE) - .setParentsHidden("MIRROR") - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_DISLOCATOR)) - .setSecondary(); + LibResearch.KEY_DISLOCATOR, + new AspectList().add(Aspect.TRAVEL, 2).add(Aspect.MECHANISM, 1).add(Aspect.ELDRITCH, 1), + -6, + 1, + 3, + new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_INTERFACE).setParentsHidden("MIRROR") + .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_DISLOCATOR)) + .setSecondary(); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorInterface.java b/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorInterface.java index 15b00a1a..cb7e43d0 100644 --- a/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorInterface.java +++ b/src/main/java/thaumic/tinkerer/common/block/transvector/BlockTransvectorInterface.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 18:57:25 (GMT)] @@ -15,12 +12,14 @@ package thaumic.tinkerer.common.block.transvector; import java.util.ArrayList; + import net.minecraft.block.material.Material; import net.minecraft.init.Items; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -83,19 +82,18 @@ public class BlockTransvectorInterface extends BlockCamo { @Override public IRegisterableResearch getResearchItem() { return (IRegisterableResearch) new TTResearchItem( - LibResearch.KEY_INTERFACE, - new AspectList().add(Aspect.ENTROPY, 4).add(Aspect.ORDER, 4), - -4, - 2, - 1, - new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorInterface.class))) - .setParents(LibResearch.KEY_DARK_QUARTZ) - .setPages( - new ResearchPage("0"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE), - new ResearchPage("1"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"), - new ResearchPage("2")); + LibResearch.KEY_INTERFACE, + new AspectList().add(Aspect.ENTROPY, 4).add(Aspect.ORDER, 4), + -4, + 2, + 1, + new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTransvectorInterface.class))) + .setParents(LibResearch.KEY_DARK_QUARTZ).setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE), + new ResearchPage("1"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_INTERFACE + "1"), + new ResearchPage("2")); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/compat/BloodMagic.java b/src/main/java/thaumic/tinkerer/common/compat/BloodMagic.java index 09c96eae..6a727f4f 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/BloodMagic.java +++ b/src/main/java/thaumic/tinkerer/common/compat/BloodMagic.java @@ -9,8 +9,8 @@ public class BloodMagic { public static void setupClass() { try { - ItemFocusDeflect.DeflectBlacklist.add( - Class.forName("WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam")); + ItemFocusDeflect.DeflectBlacklist + .add(Class.forName("WayofTime.alchemicalWizardry.common.entity.projectile.EntityParticleBeam")); } catch (ClassNotFoundException e) { e.printStackTrace(); } diff --git a/src/main/java/thaumic/tinkerer/common/compat/BotaniaFunctions.java b/src/main/java/thaumic/tinkerer/common/compat/BotaniaFunctions.java index fd22c944..6ce1b77f 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/BotaniaFunctions.java +++ b/src/main/java/thaumic/tinkerer/common/compat/BotaniaFunctions.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.compat; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.item.foci.ItemFocusDeflect; import vazkii.botania.api.internal.IManaBurst; diff --git a/src/main/java/thaumic/tinkerer/common/compat/EnderStorageFunctions.java b/src/main/java/thaumic/tinkerer/common/compat/EnderStorageFunctions.java index 2044df24..5ec5d90f 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/EnderStorageFunctions.java +++ b/src/main/java/thaumic/tinkerer/common/compat/EnderStorageFunctions.java @@ -1,9 +1,7 @@ package thaumic.tinkerer.common.compat; -import codechicken.enderstorage.api.EnderStorageManager; -import codechicken.enderstorage.storage.item.EnderItemStorage; -import codechicken.enderstorage.storage.item.TileEnderChest; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -11,10 +9,15 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import thaumcraft.common.items.wands.ItemWandCasting; import thaumic.tinkerer.common.item.foci.ItemFocusEnderChest; +import codechicken.enderstorage.api.EnderStorageManager; +import codechicken.enderstorage.storage.item.EnderItemStorage; +import codechicken.enderstorage.storage.item.TileEnderChest; public class EnderStorageFunctions { + public static ItemStack onFocusRightClick(ItemStack stack, World world, EntityPlayer p, MovingObjectPosition pos) { ItemWandCasting wand = (ItemWandCasting) stack.getItem(); ItemStack focus = wand.getFocusItem(stack); @@ -50,8 +53,7 @@ public class EnderStorageFunctions { } else { int freq = focus.getTagCompound().getInteger("freq"); ((EnderItemStorage) EnderStorageManager.instance(world.isRemote) - .getStorage(getOwner(focus), freq & 0xFFF, "item")) - .openSMPGui(p, focus.getDisplayName()); + .getStorage(getOwner(focus), freq & 0xFFF, "item")).openSMPGui(p, focus.getDisplayName()); } } diff --git a/src/main/java/thaumic/tinkerer/common/compat/FumePeripheral.java b/src/main/java/thaumic/tinkerer/common/compat/FumePeripheral.java index 38278067..d7941c0b 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/FumePeripheral.java +++ b/src/main/java/thaumic/tinkerer/common/compat/FumePeripheral.java @@ -9,6 +9,7 @@ import dan200.computercraft.api.peripheral.IPeripheral; * Created by Katrina on 04/02/2015. */ public class FumePeripheral implements IPeripheral { + @Override public String getType() { return "gasRemover"; diff --git a/src/main/java/thaumic/tinkerer/common/compat/FumeTool.java b/src/main/java/thaumic/tinkerer/common/compat/FumeTool.java index e8ca0efe..7b15007c 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/FumeTool.java +++ b/src/main/java/thaumic/tinkerer/common/compat/FumeTool.java @@ -1,20 +1,21 @@ package thaumic.tinkerer.common.compat; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.turtle.*; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.IIcon; import net.minecraftforge.client.event.TextureStitchEvent; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockGas; import thaumic.tinkerer.common.item.ItemGasRemover; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.turtle.*; /** * Created by Katrina on 04/02/2015. @@ -66,15 +67,14 @@ public class FumeTool implements ITurtleUpgrade { int zs = (int) pos.posZ; for (int x = xs - 3; x < xs + 3; x++) - for (int y = ys - 3; y < ys + 3; y++) - for (int z = zs - 3; z < zs + 3; z++) { - Block block = turtle.getWorld().getBlock(x, y, z); - if (block != null && block instanceof BlockGas) { - BlockGas gas = (BlockGas) block; - gas.placeParticle(turtle.getWorld(), x, y, z); - turtle.getWorld().setBlock(x, y, z, Blocks.air, 0, 1 | 2); - } + for (int y = ys - 3; y < ys + 3; y++) for (int z = zs - 3; z < zs + 3; z++) { + Block block = turtle.getWorld().getBlock(x, y, z); + if (block != null && block instanceof BlockGas) { + BlockGas gas = (BlockGas) block; + gas.placeParticle(turtle.getWorld(), x, y, z); + turtle.getWorld().setBlock(x, y, z, Blocks.air, 0, 1 | 2); } + } // turtle.getWorld().playSoundAtEntity(turtle., "thaumcraft.wand", 0.2F, 1F); return TurtleCommandResult.success(); diff --git a/src/main/java/thaumic/tinkerer/common/compat/IndustrialcraftUnloadHelper.java b/src/main/java/thaumic/tinkerer/common/compat/IndustrialcraftUnloadHelper.java index 308fc227..534064bb 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/IndustrialcraftUnloadHelper.java +++ b/src/main/java/thaumic/tinkerer/common/compat/IndustrialcraftUnloadHelper.java @@ -1,10 +1,11 @@ package thaumic.tinkerer.common.compat; +import net.minecraftforge.common.MinecraftForge; + +import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.api.energy.tile.IEnergySink; -import net.minecraftforge.common.MinecraftForge; -import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface; /** * Created by pixlepix on 8/26/14. diff --git a/src/main/java/thaumic/tinkerer/common/compat/InfusedSeedsPlanter.java b/src/main/java/thaumic/tinkerer/common/compat/InfusedSeedsPlanter.java index c2d226c1..6f3fce13 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/InfusedSeedsPlanter.java +++ b/src/main/java/thaumic/tinkerer/common/compat/InfusedSeedsPlanter.java @@ -1,22 +1,25 @@ package thaumic.tinkerer.common.compat; -import com.enderio.core.common.compat.ICompat; -import com.enderio.core.common.util.BlockCoord; -import crazypants.enderio.machine.farm.TileFarmStation; -import crazypants.enderio.machine.farm.farmers.IHarvestResult; -import crazypants.enderio.machine.farm.farmers.PlantableFarmer; import net.minecraft.block.Block; import net.minecraft.block.BlockFarmland; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockInfusedFarmland; import thaumic.tinkerer.common.block.BlockInfusedGrain; import thaumic.tinkerer.common.block.tile.TileInfusedGrain; import thaumic.tinkerer.common.item.ItemInfusedSeeds; +import com.enderio.core.common.compat.ICompat; +import com.enderio.core.common.util.BlockCoord; + +import crazypants.enderio.machine.farm.TileFarmStation; +import crazypants.enderio.machine.farm.farmers.IHarvestResult; +import crazypants.enderio.machine.farm.farmers.PlantableFarmer; + /** * Created by katsw on 02/02/2016. */ @@ -30,7 +33,7 @@ public class InfusedSeedsPlanter extends PlantableFarmer implements ICompat { @Override protected boolean canPlant(World worldObj, BlockCoord bc, IPlantable plantable) { return (super.canPlant(worldObj, bc, plantable) - && plantable == ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class)) + && plantable == ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedSeeds.class)) || worldObj.getBlock(bc.x, bc.y - 1, bc.z) == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedFarmland.class); } @@ -61,19 +64,18 @@ public class InfusedSeedsPlanter extends PlantableFarmer implements ICompat { if (farm.getBlock(bc.getLocation(ForgeDirection.DOWN)) instanceof BlockFarmland) { BlockCoord soil = bc.getLocation(ForgeDirection.DOWN); - farm.getWorldObj() - .setBlock( - soil.x, - soil.y, - soil.z, - ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedFarmland.class)); + farm.getWorldObj().setBlock( + soil.x, + soil.y, + soil.z, + ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedFarmland.class)); } } super.plant(farm, worldObj, bc, plantable); if (seeds != null) { BlockInfusedGrain.setAspect(farm.getWorldObj(), bc.x, bc.y, bc.z, ItemInfusedSeeds.getAspect(seeds)); - ((TileInfusedGrain) farm.getWorldObj().getTileEntity(bc.x, bc.y, bc.z)).primalTendencies = - ItemInfusedSeeds.getAspectTendencies(seeds); + ((TileInfusedGrain) farm.getWorldObj().getTileEntity(bc.x, bc.y, bc.z)).primalTendencies = ItemInfusedSeeds + .getAspectTendencies(seeds); } return true; } diff --git a/src/main/java/thaumic/tinkerer/common/compat/MagnetProvider.java b/src/main/java/thaumic/tinkerer/common/compat/MagnetProvider.java index 8cd60529..96357c9b 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/MagnetProvider.java +++ b/src/main/java/thaumic/tinkerer/common/compat/MagnetProvider.java @@ -1,15 +1,18 @@ package thaumic.tinkerer.common.compat; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumic.tinkerer.common.block.tile.TileMagnet; import thaumic.tinkerer.common.block.tile.TileMobMagnet; import thaumic.tinkerer.common.item.ItemSoulMould; @@ -22,14 +25,14 @@ public class MagnetProvider implements IWailaDataProvider { } @Override - public List getWailaHead( - ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { return currenttip; } @Override - public List getWailaBody( - ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { boolean mobMagnet = accessor.getTileEntity() instanceof TileMobMagnet; TileMagnet tileMagnet = (TileMagnet) accessor.getTileEntity(); @@ -47,10 +50,9 @@ public class MagnetProvider implements IWailaDataProvider { } else { String name = ItemSoulMould.getPatternName(tileMob.getStackInSlot(0)); name = StatCollector.translateToLocal("entity." + name + ".name"); - if (isPulling) - if (tileMob.adult) - currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.pullingAdultType", name)); - else currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.pullingChildType", name)); + if (isPulling) if (tileMob.adult) + currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.pullingAdultType", name)); + else currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.pullingChildType", name)); else if (tileMob.adult) currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.pushingAdultType", name)); else currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.pushingChildType", name)); @@ -60,14 +62,14 @@ public class MagnetProvider implements IWailaDataProvider { } @Override - public List getWailaTail( - ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { return currenttip; } @Override - public NBTTagCompound getNBTData( - EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) { + public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, + int y, int z) { // TODO Auto-generated method stub return tag; } diff --git a/src/main/java/thaumic/tinkerer/common/compat/OCCompat.java b/src/main/java/thaumic/tinkerer/common/compat/OCCompat.java index 9ece839f..b7e212ac 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/OCCompat.java +++ b/src/main/java/thaumic/tinkerer/common/compat/OCCompat.java @@ -4,5 +4,6 @@ package thaumic.tinkerer.common.compat; * Created by Katrina on 22/04/14. */ public class OCCompat { + public static void InitOC() {} } diff --git a/src/main/java/thaumic/tinkerer/common/compat/TTinkererProvider.java b/src/main/java/thaumic/tinkerer/common/compat/TTinkererProvider.java index 1ccf36de..90fd7ec0 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/TTinkererProvider.java +++ b/src/main/java/thaumic/tinkerer/common/compat/TTinkererProvider.java @@ -1,16 +1,19 @@ package thaumic.tinkerer.common.compat; import java.util.List; + import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.IWailaRegistrar; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockAnimationTablet; import thaumic.tinkerer.common.block.BlockMagnet; @@ -38,14 +41,14 @@ public class TTinkererProvider implements IWailaDataProvider { } @Override - public List getWailaHead( - ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public List getWailaHead(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { return currenttip; } @Override - public List getWailaBody( - ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public List getWailaBody(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { if (accessor.getBlock() == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockAnimationTablet.class)) { TileAnimationTablet tileAn = (TileAnimationTablet) accessor.getTileEntity(); String currentTool; @@ -85,9 +88,8 @@ public class TTinkererProvider implements IWailaDataProvider { if (item != null) { if (item.getItemDamage() > 0) currenttip.add(StatCollector.translateToLocalFormatted("ttwaila.repairing", item.getDisplayName())); - else - currenttip.add(StatCollector.translateToLocalFormatted( - "ttwaila.finishedRepairing", item.getDisplayName())); + else currenttip.add( + StatCollector.translateToLocalFormatted("ttwaila.finishedRepairing", item.getDisplayName())); } } if (accessor.getBlock() == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWarpGate.class)) { @@ -99,15 +101,15 @@ public class TTinkererProvider implements IWailaDataProvider { } @Override - public List getWailaTail( - ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { + public List getWailaTail(ItemStack itemStack, List currenttip, IWailaDataAccessor accessor, + IWailaConfigHandler config) { // TODO Auto-generated method stub return currenttip; } @Override - public NBTTagCompound getNBTData( - EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, int y, int z) { + public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x, + int y, int z) { // TODO Auto-generated method stub return tag; } diff --git a/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java b/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java index 8565ff93..c1197d8e 100644 --- a/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java +++ b/src/main/java/thaumic/tinkerer/common/compat/TinkersConstructCompat.java @@ -3,6 +3,7 @@ package thaumic.tinkerer.common.compat; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; + import tconstruct.library.tools.AbilityHelper; import tconstruct.library.tools.ToolCore; import thaumic.tinkerer.common.core.helper.ItemNBTHelper; diff --git a/src/main/java/thaumic/tinkerer/common/core/commands/KamiUnlockedCommand.java b/src/main/java/thaumic/tinkerer/common/core/commands/KamiUnlockedCommand.java index 5b2591ec..ea12f200 100644 --- a/src/main/java/thaumic/tinkerer/common/core/commands/KamiUnlockedCommand.java +++ b/src/main/java/thaumic/tinkerer/common/core/commands/KamiUnlockedCommand.java @@ -3,11 +3,14 @@ package thaumic.tinkerer.common.core.commands; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; + import org.apache.commons.lang3.StringUtils; + import thaumcraft.common.lib.research.ResearchManager; import thaumic.tinkerer.common.research.ResearchHelper; @@ -15,6 +18,7 @@ import thaumic.tinkerer.common.research.ResearchHelper; * Created by Katrina on 27/02/14. */ public class KamiUnlockedCommand extends CommandBase { + @Override public String getCommandName() { return "iskamiunlocked"; @@ -56,42 +60,38 @@ public class KamiUnlockedCommand extends CommandBase { } /** - * Compares this object with the specified object for order. Returns a - * negative integer, zero, or a positive integer as this object is less - * than, equal to, or greater than the specified object. + * Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer + * as this object is less than, equal to, or greater than the specified object. *

- *

The implementor must ensure sgn(x.compareTo(y)) == - * -sgn(y.compareTo(x)) for all x and y. (This - * implies that x.compareTo(y) must throw an exception iff - * y.compareTo(x) throws an exception.) + *

+ * The implementor must ensure sgn(x.compareTo(y)) == + * -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must + * throw an exception iff y.compareTo(x) throws an exception.) *

- *

The implementor must also ensure that the relation is transitive: - * (x.compareTo(y)>0 && y.compareTo(z)>0) implies - * x.compareTo(z)>0. + *

+ * The implementor must also ensure that the relation is transitive: + * (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0. *

- *

Finally, the implementor must ensure that x.compareTo(y)==0 - * implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for - * all z. + *

+ * Finally, the implementor must ensure that x.compareTo(y)==0 implies that + * sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z. *

- *

It is strongly recommended, but not strictly required that - * (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any - * class that implements the Comparable interface and violates - * this condition should clearly indicate this fact. The recommended - * language is "Note: this class has a natural ordering that is + *

+ * It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). + * Generally speaking, any class that implements the Comparable interface and violates this condition + * should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is * inconsistent with equals." *

- *

In the foregoing description, the notation - * sgn(expression) designates the mathematical - * signum function, which is defined to return one of -1, - * 0, or 1 according to whether the value of - * expression is negative, zero or positive. + *

+ * In the foregoing description, the notation sgn(expression) designates the mathematical + * signum function, which is defined to return one of -1, 0, or 1 according to + * whether the value of expression is negative, zero or positive. * * @param o the object to be compared. - * @return a negative integer, zero, or a positive integer as this object - * is less than, equal to, or greater than the specified object. + * @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than + * the specified object. * @throws NullPointerException if the specified object is null - * @throws ClassCastException if the specified object's type prevents it - * from being compared to this object. + * @throws ClassCastException if the specified object's type prevents it from being compared to this object. */ @Override public int compareTo(Object o) { diff --git a/src/main/java/thaumic/tinkerer/common/core/commands/MaxResearchCommand.java b/src/main/java/thaumic/tinkerer/common/core/commands/MaxResearchCommand.java index 2bcfcfdf..d807b8c6 100644 --- a/src/main/java/thaumic/tinkerer/common/core/commands/MaxResearchCommand.java +++ b/src/main/java/thaumic/tinkerer/common/core/commands/MaxResearchCommand.java @@ -4,6 +4,7 @@ import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.Thaumcraft; import thaumic.tinkerer.common.core.handler.ConfigHandler; diff --git a/src/main/java/thaumic/tinkerer/common/core/commands/SetTendencyCommand.java b/src/main/java/thaumic/tinkerer/common/core/commands/SetTendencyCommand.java index 857689f5..d31375ed 100644 --- a/src/main/java/thaumic/tinkerer/common/core/commands/SetTendencyCommand.java +++ b/src/main/java/thaumic/tinkerer/common/core/commands/SetTendencyCommand.java @@ -5,6 +5,7 @@ import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.MovingObjectPosition; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.lib.utils.BlockUtils; import thaumic.tinkerer.common.block.tile.TileInfusedGrain; @@ -14,6 +15,7 @@ import thaumic.tinkerer.common.core.handler.ConfigHandler; * Created by pixlepix on 8/16/14. */ public class SetTendencyCommand extends CommandBase { + @Override public String getCommandName() { return "setCropTendency"; @@ -30,8 +32,8 @@ public class SetTendencyCommand extends CommandBase { EntityPlayer player = (EntityPlayer) sender; MovingObjectPosition pos = BlockUtils.getTargetBlock(player.worldObj, player, true); if (player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ) instanceof TileInfusedGrain) { - TileInfusedGrain tile = - (TileInfusedGrain) player.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ); + TileInfusedGrain tile = (TileInfusedGrain) player.worldObj + .getTileEntity(pos.blockX, pos.blockY, pos.blockZ); for (Aspect a : Aspect.getPrimalAspects()) { if (args[0].toUpperCase().equals(a.getName().toUpperCase())) { try { diff --git a/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemCores.java b/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemCores.java index 4c82e87e..3c96f76a 100644 --- a/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemCores.java +++ b/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemCores.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.core.golems; public enum EnumGolemCores { + CoreFill((byte) 0, "item.ItemGolemCore.0.name"), CoreEmpty((byte) 1, "item.ItemGolemCore.1.name"), CoreGather((byte) 2, "item.ItemGolemCore.2.name"), @@ -13,8 +14,7 @@ public enum EnumGolemCores { CoreButcher((byte) 9, "item.ItemGolemCore.9.name"), CoreSorting((byte) 10, "item.ItemGolemCore.10.name"), CoreFishing((byte) 11, "item.ItemGolemCore.11.name"), - CoreBlank((byte) 100, "item.ItemGolemCore.100.name"), - ; + CoreBlank((byte) 100, "item.ItemGolemCore.100.name"),; private String name; private byte coreByte; diff --git a/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemDecorations.java b/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemDecorations.java index 96183b1e..ed082b20 100644 --- a/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemDecorations.java +++ b/src/main/java/thaumic/tinkerer/common/core/golems/EnumGolemDecorations.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.core.golems; public enum EnumGolemDecorations { + TopHat('H', "item.ItemGolemDecoration.0.name"), Glasses('G', "item.ItemGolemDecoration.1.name"), BowTie('B', "item.ItemGolemDecoration.2.name"), diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/ConfigHandler.java b/src/main/java/thaumic/tinkerer/common/core/handler/ConfigHandler.java index 277fdf32..6763999e 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/ConfigHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/ConfigHandler.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:53:24 (GMT)] @@ -15,8 +12,10 @@ package thaumic.tinkerer.common.core.handler; import java.io.File; + import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; + import thaumic.tinkerer.common.dim.OreClusterGenerator; import thaumic.tinkerer.common.lib.LibEnchantIDs; import thaumic.tinkerer.common.lib.LibEnchantNames; @@ -67,13 +66,13 @@ public final class ConfigHandler { forbiddenDimensions = config.getStringList( "Forbidden Dimensions", "general", - new String[] {""}, + new String[] { "" }, "Disallow Bottomless Pouch inventory for certain dimension ID's"); blockBlacklist = config.getStringList( "Focus of Dislocation Blacklist", "general", - new String[] {"avaritiaddons:CompressedChest", "avaritiaddons:InfinityChest"}, + new String[] { "avaritiaddons:CompressedChest", "avaritiaddons:InfinityChest" }, "These blocks will be disallowed for Focus of Dislocation"); enableKami = config.getBoolean("kami.forceenabled", "general", true, "Set to true to enable all KAMI stuff"); @@ -90,14 +89,17 @@ public final class ConfigHandler { true, "Set to false to disable the crafting recipe for the Tome of Research Sharing."); - enableDebugCommands = config.getBoolean( - "debugCommands.enabled", "general", false, "Set to true to enable debugging commands."); + enableDebugCommands = config + .getBoolean("debugCommands.enabled", "general", false, "Set to true to enable debugging commands."); - enableFlight = - config.getBoolean("modFlight.enabled", "general", true, "Set to true to enable flight in this mod."); + enableFlight = config + .getBoolean("modFlight.enabled", "general", true, "Set to true to enable flight in this mod."); repairTConTools = config.getBoolean( - "repairTconTools.enabled", "general", false, "Can Thaumic Tinkerer repair Tinkers Construct tools."); + "repairTconTools.enabled", + "general", + false, + "Can Thaumic Tinkerer repair Tinkers Construct tools."); useOreDictMetal = config.getBoolean( "oreDictMetal.enabled", @@ -135,10 +137,10 @@ public final class ConfigHandler { // Potions potionFireId = config.getInt("Fire Potion id", "potions", 88, 30, 1023, "Set to the potion id for fire potion"); - potionEarthId = - config.getInt("Earth Potion id", "potions", 87, 30, 1023, "Set to the potion id for earth potion"); - potionWaterId = - config.getInt("Water Potion id", "potions", 89, 30, 1023, "Set to the potion id for water potion"); + potionEarthId = config + .getInt("Earth Potion id", "potions", 87, 30, 1023, "Set to the potion id for earth potion"); + potionWaterId = config + .getInt("Water Potion id", "potions", 89, 30, 1023, "Set to the potion id for water potion"); potionAirId = config.getInt("Air Potion id", "potions", 86, 30, 1023, "Set to the potion id for air potion"); if (enableKami) { @@ -154,7 +156,7 @@ public final class ConfigHandler { OreClusterGenerator.blacklist = config.getStringList( "Bedrock dimension ore Blacklist", "general.kami", - new String[] {"oreFirestone"}, + new String[] { "oreFirestone" }, "These ores will not be spawned in the bedrock dimension"); OreClusterGenerator.density = config.getInt( diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/ModCreativeTab.java b/src/main/java/thaumic/tinkerer/common/core/handler/ModCreativeTab.java index 1a6d1ead..f8929e3e 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/ModCreativeTab.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/ModCreativeTab.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 15:48:07 (GMT)] @@ -17,10 +14,12 @@ package thaumic.tinkerer.common.core.handler; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigItems; @@ -64,16 +63,10 @@ public class ModCreativeTab extends CreativeTabs { ItemStack wand = new ItemStack(ConfigItems.itemWandCasting); ((ItemWandCasting) wand.getItem()).setRod(wand, ConfigItems.WAND_ROD_SILVERWOOD); ((ItemWandCasting) wand.getItem()).setCap(wand, ConfigItems.WAND_CAP_THAUMIUM); - ((ItemWandCasting) wand.getItem()) - .storeAllVis( - wand, - new AspectList() - .add(Aspect.AIR, 10000) - .add(Aspect.EARTH, 10000) - .add(Aspect.FIRE, 10000) - .add(Aspect.WATER, 10000) - .add(Aspect.ORDER, 10000) - .add(Aspect.ENTROPY, 10000)); + ((ItemWandCasting) wand.getItem()).storeAllVis( + wand, + new AspectList().add(Aspect.AIR, 10000).add(Aspect.EARTH, 10000).add(Aspect.FIRE, 10000) + .add(Aspect.WATER, 10000).add(Aspect.ORDER, 10000).add(Aspect.ENTROPY, 10000)); if (list != null) list.add(wand); displayItem = wand; @@ -81,16 +74,10 @@ public class ModCreativeTab extends CreativeTabs { ItemStack wand1 = new ItemStack(ConfigItems.itemWandCasting); ((ItemWandCasting) wand1.getItem()).setRod(wand1, ThaumicTinkerer.proxy.rodIchor); ((ItemWandCasting) wand1.getItem()).setCap(wand1, ThaumicTinkerer.proxy.capIchor); - ((ItemWandCasting) wand1.getItem()) - .storeAllVis( - wand1, - new AspectList() - .add(Aspect.AIR, 100000) - .add(Aspect.EARTH, 100000) - .add(Aspect.FIRE, 100000) - .add(Aspect.WATER, 100000) - .add(Aspect.ORDER, 100000) - .add(Aspect.ENTROPY, 100000)); + ((ItemWandCasting) wand1.getItem()).storeAllVis( + wand1, + new AspectList().add(Aspect.AIR, 100000).add(Aspect.EARTH, 100000).add(Aspect.FIRE, 100000) + .add(Aspect.WATER, 100000).add(Aspect.ORDER, 100000).add(Aspect.ENTROPY, 100000)); if (list != null) list.add(wand1); displayItem = wand1; } diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/kami/DimensionalShardDropHandler.java b/src/main/java/thaumic/tinkerer/common/core/handler/kami/DimensionalShardDropHandler.java index 92a0b770..d8ffc3a3 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/kami/DimensionalShardDropHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/kami/DimensionalShardDropHandler.java @@ -1,29 +1,27 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 11:05:53 PM (GMT)] */ package thaumic.tinkerer.common.core.handler.kami; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingDropsEvent; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.item.kami.ItemKamiResource; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class DimensionalShardDropHandler { @@ -33,22 +31,30 @@ public class DimensionalShardDropHandler { if (event.entityLiving instanceof EntityEnderman && event.entityLiving.dimension == ConfigHandler.endDimensionID && Math.random() <= 1D / 32D) - event.drops.add(new EntityItem( - event.entityLiving.worldObj, - event.entityLiving.posX, - event.entityLiving.posY, - event.entityLiving.posZ, - new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7))); + event.drops.add( + new EntityItem( + event.entityLiving.worldObj, + event.entityLiving.posX, + event.entityLiving.posY, + event.entityLiving.posZ, + new ItemStack( + ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), + 1, + 7))); if (event.entityLiving instanceof EntityPigZombie && event.entityLiving.dimension == ConfigHandler.netherDimensionID && Math.random() <= 1D / 16D) - event.drops.add(new EntityItem( - event.entityLiving.worldObj, - event.entityLiving.posX, - event.entityLiving.posY, - event.entityLiving.posZ, - new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 6))); + event.drops.add( + new EntityItem( + event.entityLiving.worldObj, + event.entityLiving.posX, + event.entityLiving.posY, + event.entityLiving.posZ, + new ItemStack( + ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), + 1, + 6))); } } } diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiArmorHandler.java b/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiArmorHandler.java index 71f65ee4..599bdee2 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiArmorHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiArmorHandler.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.core.handler.kami; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; + import thaumic.tinkerer.common.lib.LibMisc; /** diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiDimensionHandler.java b/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiDimensionHandler.java index 273891b4..06b0df37 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiDimensionHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/kami/KamiDimensionHandler.java @@ -1,10 +1,11 @@ package thaumic.tinkerer.common.core.handler.kami; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import thaumic.tinkerer.common.item.kami.tool.ItemIchorPickAdv; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; /** * Created by Katrina on 31/03/14. diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/kami/SoulHeartHandler.java b/src/main/java/thaumic/tinkerer/common/core/handler/kami/SoulHeartHandler.java index 03a4aef9..f2900e63 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/kami/SoulHeartHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/kami/SoulHeartHandler.java @@ -1,20 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 9:33:23 PM (GMT)] */ package thaumic.tinkerer.common.core.handler.kami; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -23,9 +19,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.util.DamageSource; import net.minecraftforge.event.entity.living.LivingHurtEvent; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.lib.LibMisc; import thaumic.tinkerer.common.network.packet.kami.PacketSoulHearts; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class SoulHeartHandler { @@ -93,7 +91,7 @@ public class SoulHeartHandler { if (!par1DamageSource.isUnblockable()) { int i = 25 - entity.getTotalArmorValue(); float f1 = par2 * i; - // this.damageArmor(par2); + // this.damageArmor(par2); par2 = f1 / 25.0F; } diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/updater/ThreadUpdateChecker.java b/src/main/java/thaumic/tinkerer/common/core/handler/updater/ThreadUpdateChecker.java index 4b2224f9..295304ad 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/updater/ThreadUpdateChecker.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/updater/ThreadUpdateChecker.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [3 Oct 2013, 21:36:13 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/core/handler/updater/UpdateHandler.java b/src/main/java/thaumic/tinkerer/common/core/handler/updater/UpdateHandler.java index 68dcc18e..624ae21b 100644 --- a/src/main/java/thaumic/tinkerer/common/core/handler/updater/UpdateHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/handler/updater/UpdateHandler.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [3 Oct 2013, 21:35:22 (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.core.handler.updater; public final class UpdateHandler { + // TODO: Check if this can be removed public static void initChecking(int type) { if (type == 0) {} diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java b/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java index 639380e9..b0dc6930 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/AspectCropLootManager.java @@ -3,11 +3,14 @@ package thaumic.tinkerer.common.core.helper; import java.util.HashMap; import java.util.Map; import java.util.Random; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; + import org.apache.commons.lang3.text.WordUtils; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; @@ -23,8 +26,7 @@ import thaumic.tinkerer.common.item.ItemInfusedGrain; */ public class AspectCropLootManager { - private static HashMap> lootMap = - new HashMap>(); + private static HashMap> lootMap = new HashMap>(); public static ItemStack getLootForAspect(Aspect aspect) { HashMap aspectHashmap = lootMap.get(aspect); @@ -178,7 +180,8 @@ public class AspectCropLootManager { addAspectLoot(Aspect.LIGHT, new ItemStack(Items.glowstone_dust, 16), 5); addAspectLoot(Aspect.LIGHT, new ItemStack(ConfigItems.itemResource, 4, 1)); addAspectLoot( - Aspect.LIGHT, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class))); + Aspect.LIGHT, + new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class))); addAspectLoot(Aspect.MECHANISM, new ItemStack(Blocks.piston, 8)); // addAspectLoot(Aspect.MECHANISM, "gear"); diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/BlockTuple.java b/src/main/java/thaumic/tinkerer/common/core/helper/BlockTuple.java index a7aa067d..278b5265 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/BlockTuple.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/BlockTuple.java @@ -6,6 +6,7 @@ import net.minecraft.block.Block; * Created by pixlepix on 9/28/14. */ public class BlockTuple { + public Block block; public int meta; diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/BonemealEventHandler.java b/src/main/java/thaumic/tinkerer/common/core/helper/BonemealEventHandler.java index 2834f3f4..f27f3c29 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/BonemealEventHandler.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/BonemealEventHandler.java @@ -1,13 +1,14 @@ package thaumic.tinkerer.common.core.helper; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.IGrowable; import net.minecraftforge.event.entity.player.BonemealEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigItems; import thaumic.tinkerer.common.block.BlockInfusedGrain; import thaumic.tinkerer.common.core.handler.ConfigHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; /** * Created by pixlepix on 8/28/14. diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/EnumMobAspect.java b/src/main/java/thaumic/tinkerer/common/core/helper/EnumMobAspect.java index cb2b6392..7d6f3f27 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/EnumMobAspect.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/EnumMobAspect.java @@ -1,13 +1,14 @@ package thaumic.tinkerer.common.core.helper; -import com.google.common.collect.Maps; import java.util.Map; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.monster.*; import net.minecraft.entity.passive.*; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.InfusionRecipe; @@ -21,46 +22,51 @@ import thaumic.tinkerer.common.item.ItemMobAspect; import thaumic.tinkerer.common.item.ItemMobDisplay; import thaumic.tinkerer.common.lib.LibResearch; +import com.google.common.collect.Maps; + public enum EnumMobAspect { - SnowMan(EntitySnowman.class, new Aspect[] {Aspect.WATER, Aspect.WATER, Aspect.MAN}), - Bat(EntityBat.class, new Aspect[] {Aspect.AIR, Aspect.AIR, Aspect.FLIGHT}, 1.9f, -0.3f), - Blaze(EntityBlaze.class, new Aspect[] {Aspect.FIRE, Aspect.FIRE, Aspect.FIRE}), - BrainyZombie(EntityBrainyZombie.class, new Aspect[] {Aspect.MAGIC, Aspect.UNDEAD, Aspect.FLESH}, "Thaumcraft."), - Firebat(EntityFireBat.class, new Aspect[] {Aspect.FLIGHT, Aspect.FIRE, Aspect.MAGIC}, 1.9f, -0.3f), - CaveSpider(EntityCaveSpider.class, new Aspect[] {Aspect.BEAST, Aspect.POISON, Aspect.POISON}), - Chicken(EntityChicken.class, new Aspect[] {Aspect.CROP, Aspect.FLIGHT, Aspect.BEAST}), - Cow(EntityCow.class, new Aspect[] {Aspect.BEAST, Aspect.EARTH, Aspect.BEAST}), - Creeper(EntityCreeper.class, new Aspect[] {Aspect.MAGIC, Aspect.BEAST, Aspect.ELDRITCH}), - Enderman(EntityEnderman.class, new Aspect[] {Aspect.ELDRITCH, Aspect.ELDRITCH, Aspect.MAN}, 0.3f, 0.0f), - Ghast(EntityGhast.class, new Aspect[] {Aspect.FIRE, Aspect.FLIGHT, Aspect.FLIGHT}, 0.1f, 0.2f), - EntityHorse(EntityHorse.class, new Aspect[] {Aspect.BEAST, Aspect.BEAST, Aspect.TRAVEL}), - VillagerGolem(EntityIronGolem.class, new Aspect[] {Aspect.METAL, Aspect.METAL, Aspect.MAN}, 0.3f, 0.0f), - LavaSlime(EntityMagmaCube.class, new Aspect[] {Aspect.FIRE, Aspect.SLIME, Aspect.SLIME}, 0.6f, 0.0f) { + + SnowMan(EntitySnowman.class, new Aspect[] { Aspect.WATER, Aspect.WATER, Aspect.MAN }), + Bat(EntityBat.class, new Aspect[] { Aspect.AIR, Aspect.AIR, Aspect.FLIGHT }, 1.9f, -0.3f), + Blaze(EntityBlaze.class, new Aspect[] { Aspect.FIRE, Aspect.FIRE, Aspect.FIRE }), + BrainyZombie(EntityBrainyZombie.class, new Aspect[] { Aspect.MAGIC, Aspect.UNDEAD, Aspect.FLESH }, "Thaumcraft."), + Firebat(EntityFireBat.class, new Aspect[] { Aspect.FLIGHT, Aspect.FIRE, Aspect.MAGIC }, 1.9f, -0.3f), + CaveSpider(EntityCaveSpider.class, new Aspect[] { Aspect.BEAST, Aspect.POISON, Aspect.POISON }), + Chicken(EntityChicken.class, new Aspect[] { Aspect.CROP, Aspect.FLIGHT, Aspect.BEAST }), + Cow(EntityCow.class, new Aspect[] { Aspect.BEAST, Aspect.EARTH, Aspect.BEAST }), + Creeper(EntityCreeper.class, new Aspect[] { Aspect.MAGIC, Aspect.BEAST, Aspect.ELDRITCH }), + Enderman(EntityEnderman.class, new Aspect[] { Aspect.ELDRITCH, Aspect.ELDRITCH, Aspect.MAN }, 0.3f, 0.0f), + Ghast(EntityGhast.class, new Aspect[] { Aspect.FIRE, Aspect.FLIGHT, Aspect.FLIGHT }, 0.1f, 0.2f), + EntityHorse(EntityHorse.class, new Aspect[] { Aspect.BEAST, Aspect.BEAST, Aspect.TRAVEL }), + VillagerGolem(EntityIronGolem.class, new Aspect[] { Aspect.METAL, Aspect.METAL, Aspect.MAN }, 0.3f, 0.0f), + LavaSlime(EntityMagmaCube.class, new Aspect[] { Aspect.FIRE, Aspect.SLIME, Aspect.SLIME }, 0.6f, 0.0f) { + @Override protected Entity createEntity(World worldObj) { return setSlimeSize(super.createEntity(worldObj), 1); } }, - MushroomCow(EntityMooshroom.class, new Aspect[] {Aspect.BEAST, Aspect.EARTH, Aspect.CROP}), - Ozelot(EntityOcelot.class, new Aspect[] {Aspect.BEAST, Aspect.EARTH, Aspect.ELDRITCH}), - Pig(EntityPig.class, new Aspect[] {Aspect.BEAST, Aspect.EARTH, Aspect.TRAVEL}), - PigZombie(EntityPigZombie.class, new Aspect[] {Aspect.UNDEAD, Aspect.FLESH, Aspect.FIRE}), - Sheep(EntitySheep.class, new Aspect[] {Aspect.EARTH, Aspect.CLOTH, Aspect.BEAST}), - Silverfish(EntitySilverfish.class, new Aspect[] {Aspect.METAL, Aspect.METAL, Aspect.EARTH}), - Skeleton(EntitySkeleton.class, new Aspect[] {Aspect.UNDEAD, Aspect.MAN, Aspect.UNDEAD}), - Slime(EntitySlime.class, new Aspect[] {Aspect.SLIME, Aspect.SLIME, Aspect.BEAST}, 0.6f, 0.0f) { + MushroomCow(EntityMooshroom.class, new Aspect[] { Aspect.BEAST, Aspect.EARTH, Aspect.CROP }), + Ozelot(EntityOcelot.class, new Aspect[] { Aspect.BEAST, Aspect.EARTH, Aspect.ELDRITCH }), + Pig(EntityPig.class, new Aspect[] { Aspect.BEAST, Aspect.EARTH, Aspect.TRAVEL }), + PigZombie(EntityPigZombie.class, new Aspect[] { Aspect.UNDEAD, Aspect.FLESH, Aspect.FIRE }), + Sheep(EntitySheep.class, new Aspect[] { Aspect.EARTH, Aspect.CLOTH, Aspect.BEAST }), + Silverfish(EntitySilverfish.class, new Aspect[] { Aspect.METAL, Aspect.METAL, Aspect.EARTH }), + Skeleton(EntitySkeleton.class, new Aspect[] { Aspect.UNDEAD, Aspect.MAN, Aspect.UNDEAD }), + Slime(EntitySlime.class, new Aspect[] { Aspect.SLIME, Aspect.SLIME, Aspect.BEAST }, 0.6f, 0.0f) { + @Override protected Entity createEntity(World worldObj) { return setSlimeSize(super.createEntity(worldObj), 1); } }, - Spider(EntitySpider.class, new Aspect[] {Aspect.BEAST, Aspect.UNDEAD, Aspect.UNDEAD}), - Squid(EntitySquid.class, new Aspect[] {Aspect.WATER, Aspect.WATER, Aspect.WATER}, 0.3f, 0.5f), - Villager(EntityVillager.class, new Aspect[] {Aspect.MAN, Aspect.MAN, Aspect.MAN}), - Wisp(EntityWisp.class, new Aspect[] {Aspect.AIR, Aspect.MAGIC, Aspect.MAGIC}, "Thaumcraft."), - Witch(EntityWitch.class, new Aspect[] {Aspect.MAGIC, Aspect.UNDEAD, Aspect.ELDRITCH}, 0.35f, 0.0f), - Wolf(EntityWolf.class, new Aspect[] {Aspect.BEAST, Aspect.BEAST, Aspect.BEAST}), - Zombie(EntityZombie.class, new Aspect[] {Aspect.FLESH, Aspect.FLESH, Aspect.UNDEAD}); + Spider(EntitySpider.class, new Aspect[] { Aspect.BEAST, Aspect.UNDEAD, Aspect.UNDEAD }), + Squid(EntitySquid.class, new Aspect[] { Aspect.WATER, Aspect.WATER, Aspect.WATER }, 0.3f, 0.5f), + Villager(EntityVillager.class, new Aspect[] { Aspect.MAN, Aspect.MAN, Aspect.MAN }), + Wisp(EntityWisp.class, new Aspect[] { Aspect.AIR, Aspect.MAGIC, Aspect.MAGIC }, "Thaumcraft."), + Witch(EntityWitch.class, new Aspect[] { Aspect.MAGIC, Aspect.UNDEAD, Aspect.ELDRITCH }, 0.35f, 0.0f), + Wolf(EntityWolf.class, new Aspect[] { Aspect.BEAST, Aspect.BEAST, Aspect.BEAST }), + Zombie(EntityZombie.class, new Aspect[] { Aspect.FLESH, Aspect.FLESH, Aspect.UNDEAD }); public static Map entityCache = Maps.newHashMap(); public Aspect[] aspects; diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/FakeContainerCrafting.java b/src/main/java/thaumic/tinkerer/common/core/helper/FakeContainerCrafting.java index a5132a69..7d4bea96 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/FakeContainerCrafting.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/FakeContainerCrafting.java @@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack; * Created by pixlepix on 9/28/14. */ public class FakeContainerCrafting extends Container { + public FakeContainerCrafting(ItemStack item) { for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(new FakeInventory(item), i, 0, 0)); diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/ItemNBTHelper.java b/src/main/java/thaumic/tinkerer/common/core/helper/ItemNBTHelper.java index 128069f5..f9181bd8 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/ItemNBTHelper.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/ItemNBTHelper.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 19:36:25 (GMT)] @@ -27,8 +24,7 @@ public final class ItemNBTHelper { } /** - * Tries to initialize an NBT Tag Compound in an ItemStack, - * this will not do anything if the stack already has a tag + * Tries to initialize an NBT Tag Compound in an ItemStack, this will not do anything if the stack already has a tag * compound * */ public static void initNBT(ItemStack stack) { @@ -36,16 +32,14 @@ public final class ItemNBTHelper { } /** - * Injects an NBT Tag Compound to an ItemStack, no checks - * are made previously * + * Injects an NBT Tag Compound to an ItemStack, no checks are made previously * */ public static void injectNBT(ItemStack stack, NBTTagCompound nbt) { stack.setTagCompound(nbt); } /** - * Gets the NBTTagCompound in an ItemStack. Tries to init it - * previously in case there isn't one present * + * Gets the NBTTagCompound in an ItemStack. Tries to init it previously in case there isn't one present * */ public static NBTTagCompound getNBT(ItemStack stack) { initNBT(stack); @@ -84,11 +78,11 @@ public final class ItemNBTHelper { public static void setCompound(ItemStack stack, String tag, NBTTagCompound cmp) { if (!tag.equalsIgnoreCase("ench")) // not override the enchantments - getNBT(stack).setTag(tag, cmp); + getNBT(stack).setTag(tag, cmp); } // public static void setCompound(ItemStack stack, NBTTagCompound cmp) { - // setCompound(stack, cmp, cmp); + // setCompound(stack, cmp, cmp); // } public static void setString(ItemStack stack, String tag, String s) { @@ -130,12 +124,10 @@ public final class ItemNBTHelper { } /** - * If nullifyOnFail is true it'll return null if it doesn't find any - * compounds, otherwise it'll return a new one. * + * If nullifyOnFail is true it'll return null if it doesn't find any compounds, otherwise it'll return a new one. * */ public static NBTTagCompound getCompound(ItemStack stack, String tag, boolean nullifyOnFail) { - return verifyExistance(stack, tag) - ? getNBT(stack).getCompoundTag(tag) + return verifyExistance(stack, tag) ? getNBT(stack).getCompoundTag(tag) : nullifyOnFail ? null : new NBTTagCompound(); } diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/MiscHelper.java b/src/main/java/thaumic/tinkerer/common/core/helper/MiscHelper.java index bef2562d..f8189ef0 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/MiscHelper.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/MiscHelper.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 01:29:47 (GMT)] @@ -22,6 +19,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.BlockEvent; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.codechicken.lib.vec.Vector3; @@ -33,8 +31,8 @@ public final class MiscHelper { return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2) + Math.pow(z1 - z2, 2)); } - public static boolean breakBlockWithCheck( - World w, int x, int y, int z, Block block, int meta, int flag, EntityPlayer player) { + public static boolean breakBlockWithCheck(World w, int x, int y, int z, Block block, int meta, int flag, + EntityPlayer player) { if (!MinecraftForge.EVENT_BUS.post(new BlockEvent.BreakEvent(x, y, z, w, w.getBlock(x, y, z), meta, player))) { w.setBlock(x, y, z, block, meta, flag); return true; diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/NumericAspectHelper.java b/src/main/java/thaumic/tinkerer/common/core/helper/NumericAspectHelper.java index 2c56a69e..f0dc0ada 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/NumericAspectHelper.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/NumericAspectHelper.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.core.helper; import java.util.ArrayList; + import thaumcraft.api.aspects.Aspect; public class NumericAspectHelper { diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/ProjectileHelper.java b/src/main/java/thaumic/tinkerer/common/core/helper/ProjectileHelper.java index ba149986..2e6588b3 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/ProjectileHelper.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/ProjectileHelper.java @@ -1,16 +1,19 @@ package thaumic.tinkerer.common.core.helper; -import com.google.common.base.Function; import java.util.IdentityHashMap; import java.util.Map; + import net.minecraft.entity.Entity; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityThrowable; + import thaumcraft.common.entities.projectile.EntityFrostShard; +import com.google.common.base.Function; + public final class ProjectileHelper { - private static Map, Function> ownerGetters = - new IdentityHashMap, Function>(); + + private static Map, Function> ownerGetters = new IdentityHashMap, Function>(); public static Entity getOwner(Entity projectile) { Function ownerGetterForClass = ownerGetters.get(projectile.getClass()); @@ -28,13 +31,14 @@ public final class ProjectileHelper { return null; } - public static void registerOwnerGetter( - Class projectileClass, Function ownerGetter) { + public static void registerOwnerGetter(Class projectileClass, + Function ownerGetter) { ownerGetters.put(projectileClass, ownerGetter); } /* Owner getters for vanilla Minecraft and Thaumcraft projectiles */ public static class VanillaArrowOwnerGetter implements Function { + @Override public Entity apply(Entity e) { return ((EntityArrow) e).shootingEntity; @@ -42,6 +46,7 @@ public final class ProjectileHelper { } public static class VanillaThrowableOwnerGetter implements Function { + @Override public Entity apply(Entity e) { return ((EntityThrowable) e).getThrower(); @@ -49,6 +54,7 @@ public final class ProjectileHelper { } public static class ThaumcraftFrostShardOwnerGetter implements Function { + @Override public Entity apply(Entity e) { Entity owner = ((EntityFrostShard) e).getThrower(); diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/ReflectionHelper.java b/src/main/java/thaumic/tinkerer/common/core/helper/ReflectionHelper.java index 71fd3a18..808c0902 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/ReflectionHelper.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/ReflectionHelper.java @@ -1,15 +1,18 @@ package thaumic.tinkerer.common.core.helper; +import java.lang.reflect.Method; +import java.util.Arrays; + +import org.apache.commons.lang3.ArrayUtils; + import com.google.common.base.Preconditions; import com.google.common.base.Throwables; -import java.lang.reflect.Method; -import java.util.Arrays; -import org.apache.commons.lang3.ArrayUtils; /** * Created by Katrina on 18/03/14. */ public class ReflectionHelper { + public static T call(Object instance, String methodName, Object... args) { return call(instance.getClass(), instance, ArrayUtils.toArray(methodName), args); } @@ -59,8 +62,7 @@ public class ReflectionHelper { while (clazz != null) { try { return clazz.getDeclaredMethod(name, argsTypes); - } catch (NoSuchMethodException e) { - } catch (Exception e) { + } catch (NoSuchMethodException e) {} catch (Exception e) { throw Throwables.propagate(e); } clazz = clazz.getSuperclass(); diff --git a/src/main/java/thaumic/tinkerer/common/core/helper/Tuple4Int.java b/src/main/java/thaumic/tinkerer/common/core/helper/Tuple4Int.java index fbd61e45..3ce8668f 100644 --- a/src/main/java/thaumic/tinkerer/common/core/helper/Tuple4Int.java +++ b/src/main/java/thaumic/tinkerer/common/core/helper/Tuple4Int.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [16 Sep 2013, 23:02:49 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/core/proxy/TTCommonProxy.java b/src/main/java/thaumic/tinkerer/common/core/proxy/TTCommonProxy.java index 72320305..983d2cc2 100644 --- a/src/main/java/thaumic/tinkerer/common/core/proxy/TTCommonProxy.java +++ b/src/main/java/thaumic/tinkerer/common/core/proxy/TTCommonProxy.java @@ -1,30 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:29:41 (GMT)] */ package thaumic.tinkerer.common.core.proxy; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLInterModComms; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import dan200.computercraft.api.ComputerCraftAPI; import li.cil.oc.api.Driver; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; @@ -33,6 +21,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; + import thaumcraft.api.aspects.IEssentiaTransport; import thaumcraft.api.wands.WandCap; import thaumcraft.api.wands.WandRod; @@ -70,6 +59,16 @@ import thaumic.tinkerer.common.peripheral.OpenComputers.*; import thaumic.tinkerer.common.peripheral.PeripheralHandler; import thaumic.tinkerer.common.potion.ModPotions; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLInterModComms; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import dan200.computercraft.api.ComputerCraftAPI; public class TTCommonProxy { @@ -97,7 +96,7 @@ public class TTCommonProxy { registerVersionChecker(); kamiRarity = EnumHelper.addEnum( - new Class[][] {{EnumRarity.class, EnumChatFormatting.class, String.class}}, + new Class[][] { { EnumRarity.class, EnumChatFormatting.class, String.class } }, EnumRarity.class, "KAMI", EnumChatFormatting.LIGHT_PURPLE, @@ -142,26 +141,32 @@ public class TTCommonProxy { } protected void registerPackets() { + ThaumicTinkerer.netHandler + .registerMessage(PacketSoulHearts.class, PacketSoulHearts.class, 142 + 0, Side.CLIENT); + ThaumicTinkerer.netHandler + .registerMessage(PacketToggleArmor.class, PacketToggleArmor.class, 142 + 1, Side.CLIENT); + ThaumicTinkerer.netHandler + .registerMessage(PacketToggleArmor.class, PacketToggleArmor.class, 142 + 2, Side.SERVER); + ThaumicTinkerer.netHandler + .registerMessage(PacketWarpGateButton.class, PacketWarpGateButton.class, 142 + 3, Side.SERVER); + ThaumicTinkerer.netHandler + .registerMessage(PacketWarpGateTeleport.class, PacketWarpGateTeleport.class, 142 + 4, Side.SERVER); ThaumicTinkerer.netHandler.registerMessage( - PacketSoulHearts.class, PacketSoulHearts.class, 142 + 0, Side.CLIENT); + PacketEnchanterAddEnchant.class, + PacketEnchanterAddEnchant.class, + 142 + 5, + Side.SERVER); ThaumicTinkerer.netHandler.registerMessage( - PacketToggleArmor.class, PacketToggleArmor.class, 142 + 1, Side.CLIENT); - ThaumicTinkerer.netHandler.registerMessage( - PacketToggleArmor.class, PacketToggleArmor.class, 142 + 2, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketWarpGateButton.class, PacketWarpGateButton.class, 142 + 3, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketWarpGateTeleport.class, PacketWarpGateTeleport.class, 142 + 4, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketEnchanterAddEnchant.class, PacketEnchanterAddEnchant.class, 142 + 5, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketEnchanterStartWorking.class, PacketEnchanterStartWorking.class, 142 + 6, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketMobMagnetButton.class, PacketMobMagnetButton.class, 142 + 7, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketTabletButton.class, PacketTabletButton.class, 142 + 8, Side.SERVER); - ThaumicTinkerer.netHandler.registerMessage( - PacketPlacerButton.class, PacketPlacerButton.class, 142 + 9, Side.SERVER); + PacketEnchanterStartWorking.class, + PacketEnchanterStartWorking.class, + 142 + 6, + Side.SERVER); + ThaumicTinkerer.netHandler + .registerMessage(PacketMobMagnetButton.class, PacketMobMagnetButton.class, 142 + 7, Side.SERVER); + ThaumicTinkerer.netHandler + .registerMessage(PacketTabletButton.class, PacketTabletButton.class, 142 + 8, Side.SERVER); + ThaumicTinkerer.netHandler + .registerMessage(PacketPlacerButton.class, PacketPlacerButton.class, 142 + 9, Side.SERVER); } public void registerVersionChecker() { @@ -188,25 +193,11 @@ public class TTCommonProxy { protected void initCCPeripherals() { PeripheralHandler handler = new PeripheralHandler(); - Class[] peripheralClasses = new Class[] { - TileAlembic.class, - TileCentrifuge.class, - TileCrucible.class, - TileFunnel.class, - TileInfusionMatrix.class, - TileJarFillable.class, - TileJarNode.class, - TileNode.class, - TileRepairer.class, - TileTubeFilter.class, - TileTransvectorInterface.class, - TileWandPedestal.class, - TileDeconstructionTable.class, - TileJarBrain.class, - TileSensor.class, - TileArcaneBore.class, - IEssentiaTransport.class - }; + Class[] peripheralClasses = new Class[] { TileAlembic.class, TileCentrifuge.class, TileCrucible.class, + TileFunnel.class, TileInfusionMatrix.class, TileJarFillable.class, TileJarNode.class, TileNode.class, + TileRepairer.class, TileTubeFilter.class, TileTransvectorInterface.class, TileWandPedestal.class, + TileDeconstructionTable.class, TileJarBrain.class, TileSensor.class, TileArcaneBore.class, + IEssentiaTransport.class }; handler.registerPeripheralProvider(); ComputerCraftAPI.registerTurtleUpgrade(new FumeTool()); diff --git a/src/main/java/thaumic/tinkerer/common/dim/ChunkProviderBedrock.java b/src/main/java/thaumic/tinkerer/common/dim/ChunkProviderBedrock.java index 30c1e137..f076dc7f 100644 --- a/src/main/java/thaumic/tinkerer/common/dim/ChunkProviderBedrock.java +++ b/src/main/java/thaumic/tinkerer/common/dim/ChunkProviderBedrock.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.dim; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; @@ -61,16 +62,16 @@ public class ChunkProviderBedrock implements IChunkProvider { for (int i1 = 0; i1 < 16; ++i1) { for (int j1 = 0; j1 < 16; ++j1) { - extendedblockstorage.func_150818_a( - i1, k & 15, j1, Block.getBlockById(this.cachedBlockIDs[k] & 255)); + extendedblockstorage + .func_150818_a(i1, k & 15, j1, Block.getBlockById(this.cachedBlockIDs[k] & 255)); extendedblockstorage.setExtBlockMetadata(i1, k & 15, j1, this.cachedBlockMetadata[k]); } } } chunk.generateSkylightMap(); - BiomeGenBase[] abiomegenbase = - this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, par1 * 16, par2 * 16, 16, 16); + BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager() + .loadBlockGeneratorData(null, par1 * 16, par2 * 16, 16, 16); byte[] abyte = chunk.getBiomeArray(); for (int k1 = 0; k1 < abyte.length; ++k1) { @@ -113,15 +114,15 @@ public class ChunkProviderBedrock implements IChunkProvider { } /** - * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. - * Return true if all chunks have been saved. + * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return + * true if all chunks have been saved. */ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { return true; } /** - * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently + * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently * unimplemented. */ public void saveExtraData() {} diff --git a/src/main/java/thaumic/tinkerer/common/dim/EnumOreFrequency.java b/src/main/java/thaumic/tinkerer/common/dim/EnumOreFrequency.java index 38b082bc..a284818a 100644 --- a/src/main/java/thaumic/tinkerer/common/dim/EnumOreFrequency.java +++ b/src/main/java/thaumic/tinkerer/common/dim/EnumOreFrequency.java @@ -3,6 +3,7 @@ package thaumic.tinkerer.common.dim; import java.util.ArrayList; import java.util.Arrays; import java.util.Random; + import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; @@ -14,6 +15,7 @@ import net.minecraftforge.oredict.OreDictionary; * Numbers here used with permission of Vazkii */ public enum EnumOreFrequency { + ALUMINUM("oreAluminum", 617), AMBER("oreAmber", 161), APATITE("oreApatite", 269), @@ -102,8 +104,7 @@ public enum EnumOreFrequency { } public boolean isValid() { - return !Arrays.asList(OreClusterGenerator.blacklist).contains(name) - && !OreDictionary.getOres(name).isEmpty() + return !Arrays.asList(OreClusterGenerator.blacklist).contains(name) && !OreDictionary.getOres(name).isEmpty() && OreDictionary.getOres(name).get(0).getItem() instanceof ItemBlock; } } diff --git a/src/main/java/thaumic/tinkerer/common/dim/OreClusterGenerator.java b/src/main/java/thaumic/tinkerer/common/dim/OreClusterGenerator.java index 99ac5643..df422276 100644 --- a/src/main/java/thaumic/tinkerer/common/dim/OreClusterGenerator.java +++ b/src/main/java/thaumic/tinkerer/common/dim/OreClusterGenerator.java @@ -1,7 +1,7 @@ package thaumic.tinkerer.common.dim; -import cpw.mods.fml.common.IWorldGenerator; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -9,18 +9,15 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; +import cpw.mods.fml.common.IWorldGenerator; + public class OreClusterGenerator implements IWorldGenerator { public static int density; - public static String[] blacklist = new String[] {"oreFirestone"}; + public static String[] blacklist = new String[] { "oreFirestone" }; @Override - public void generate( - Random random, - int chunkX, - int chunkZ, - World world, - IChunkProvider chunkGenerator, + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if (world.provider instanceof WorldProviderBedrock) { diff --git a/src/main/java/thaumic/tinkerer/common/dim/TeleporterBedrock.java b/src/main/java/thaumic/tinkerer/common/dim/TeleporterBedrock.java index 32a1461f..cf0509c1 100644 --- a/src/main/java/thaumic/tinkerer/common/dim/TeleporterBedrock.java +++ b/src/main/java/thaumic/tinkerer/common/dim/TeleporterBedrock.java @@ -5,6 +5,7 @@ import net.minecraft.world.Teleporter; import net.minecraft.world.WorldServer; public class TeleporterBedrock extends Teleporter { + public TeleporterBedrock(WorldServer w) { super(w); } diff --git a/src/main/java/thaumic/tinkerer/common/dim/WorldProviderBedrock.java b/src/main/java/thaumic/tinkerer/common/dim/WorldProviderBedrock.java index 9aaae1fe..499f98ae 100644 --- a/src/main/java/thaumic/tinkerer/common/dim/WorldProviderBedrock.java +++ b/src/main/java/thaumic/tinkerer/common/dim/WorldProviderBedrock.java @@ -1,7 +1,5 @@ package thaumic.tinkerer.common.dim; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; @@ -10,7 +8,10 @@ import net.minecraft.world.WorldProvider; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.WorldChunkManagerHell; import net.minecraft.world.chunk.IChunkProvider; + import thaumic.tinkerer.common.core.handler.ConfigHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class WorldProviderBedrock extends WorldProvider { @@ -109,7 +110,7 @@ public class WorldProviderBedrock extends WorldProvider { if ((f3 >= f4 - f2) && (f3 <= f4 + f2)) { float f5 = (f3 - f4) / f2 * 0.5F + 0.5F; float f6 = 1.0F - (1.0F - MathHelper.sin(f5 * 3.141593F)) * 0.99F; - //noinspection UnusedAssignment + // noinspection UnusedAssignment f6 *= f6; this.colorsSunriseSunset[0] = (f5 * 0.3F + 0.7F); this.colorsSunriseSunset[1] = (f5 * f5 * 0.7F + 0.2F); diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAscentBoost.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAscentBoost.java index 27d4d765..6793b5fb 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAscentBoost.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAscentBoost.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 11:50:08 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAutoSmelt.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAutoSmelt.java index b0fd3821..a47e2429 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAutoSmelt.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentAutoSmelt.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 15:16:03 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.item.ItemStack; + import thaumcraft.common.config.Config; import thaumcraft.common.config.ConfigItems; diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDesintegrate.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDesintegrate.java index 428570f8..73c67295 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDesintegrate.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDesintegrate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 15:13:35 (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; + import thaumcraft.common.config.Config; public class EnchantmentDesintegrate extends EnchantmentMod { diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDispersedStrikes.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDispersedStrikes.java index fdb58aa4..b201f12f 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDispersedStrikes.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentDispersedStrikes.java @@ -2,9 +2,11 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; + import thaumcraft.api.ThaumcraftApi; public class EnchantmentDispersedStrikes extends EnchantmentMod { + public EnchantmentDispersedStrikes(int par1) { super(par1, 5, EnumEnchantmentType.weapon); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFinalStrike.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFinalStrike.java index aee63ac5..b4995837 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFinalStrike.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFinalStrike.java @@ -2,9 +2,11 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; + import thaumcraft.api.ThaumcraftApi; public class EnchantmentFinalStrike extends EnchantmentMod { + public EnchantmentFinalStrike(int par1) { super(par1, 5, EnumEnchantmentType.weapon); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFocusedStrikes.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFocusedStrikes.java index 47a302af..5e4c9b2e 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFocusedStrikes.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentFocusedStrikes.java @@ -2,9 +2,11 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; + import thaumcraft.api.ThaumcraftApi; public class EnchantmentFocusedStrikes extends EnchantmentMod { + public EnchantmentFocusedStrikes(int par1) { super(par1, 5, EnumEnchantmentType.weapon); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentMod.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentMod.java index 683fecb9..de4fc181 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentMod.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentMod.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 11:48:50 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentPounce.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentPounce.java index dda0682e..ab9f024a 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentPounce.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentPounce.java @@ -4,6 +4,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; public class EnchantmentPounce extends EnchantmentMod { + public EnchantmentPounce(int par1) { super(par1, 5, EnumEnchantmentType.armor_legs); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentQuickDraw.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentQuickDraw.java index 36806ab8..134db09b 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentQuickDraw.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentQuickDraw.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 15:18:09 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShatter.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShatter.java index 2cc1fd59..3f53ea12 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShatter.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShatter.java @@ -4,6 +4,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; public class EnchantmentShatter extends EnchantmentMod { + public EnchantmentShatter(int par1) { super(par1, 5, EnumEnchantmentType.digger); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShockwave.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShockwave.java index 81229d21..0272f452 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShockwave.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentShockwave.java @@ -3,10 +3,12 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.item.kami.armor.ItemGemBoots; public class EnchantmentShockwave extends EnchantmentMod { + public EnchantmentShockwave(int par1) { super(par1, 5, EnumEnchantmentType.armor_feet); } @@ -14,8 +16,7 @@ public class EnchantmentShockwave extends EnchantmentMod { @Override public boolean canApply(ItemStack p_92089_1_) { - return (p_92089_1_.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemBoots.class)) - ? false + return (p_92089_1_.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemBoots.class)) ? false : super.canApply(p_92089_1_); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentSlowFall.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentSlowFall.java index 8c1d0688..bc008e8d 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentSlowFall.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentSlowFall.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 11:58:52 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.item.kami.armor.ItemGemBoots; public class EnchantmentSlowFall extends EnchantmentMod { diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentTunnel.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentTunnel.java index 8a96bd22..700ea866 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentTunnel.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentTunnel.java @@ -4,6 +4,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; public class EnchantmentTunnel extends EnchantmentMod { + public EnchantmentTunnel(int par1) { super(par1, 5, EnumEnchantmentType.digger); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentValiance.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentValiance.java index c1fca8d7..0ea745ec 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentValiance.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentValiance.java @@ -2,9 +2,11 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; + import thaumcraft.api.ThaumcraftApi; public class EnchantmentValiance extends EnchantmentMod { + public EnchantmentValiance(int par1) { super(par1, 5, EnumEnchantmentType.weapon); } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentVampirism.java b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentVampirism.java index 623eed42..6599675b 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentVampirism.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/EnchantmentVampirism.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 15:06:38 (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.item.ItemStack; + import thaumcraft.api.ThaumcraftApi; import thaumic.tinkerer.common.item.ItemBloodSword; @@ -29,7 +27,7 @@ public class EnchantmentVampirism extends EnchantmentMod { @Override public boolean canApplyTogether(Enchantment par1Enchantment) { return par1Enchantment.effectId != Enchantment.fireAspect.effectId - && par1Enchantment.effectId != Enchantment.knockback.effectId + && par1Enchantment.effectId != Enchantment.knockback.effectId || par1Enchantment.effectId == Enchantment.unbreaking.effectId || par1Enchantment.effectId == ThaumcraftApi.enchantRepair; } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantmentHandler.java b/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantmentHandler.java index b34b558b..863d0a68 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantmentHandler.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantmentHandler.java @@ -1,24 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 11:52:00 (GMT)] */ package thaumic.tinkerer.common.enchantment; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.List; import java.util.Random; import java.util.UUID; + import net.minecraft.block.material.Material; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.EntityLivingBase; @@ -34,7 +30,10 @@ import net.minecraftforge.event.entity.living.LivingFallEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.BlockEvent; + import thaumic.tinkerer.common.lib.LibEnchantIDs; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ModEnchantmentHandler { @@ -59,9 +58,10 @@ public class ModEnchantmentHandler { ItemStack legs = player.getCurrentArmor(1); int pounce = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.pounce, legs); if (pounce > 0) { - if (player.worldObj.getBlock((int) Math.floor(player.posX), (int) Math.floor(player.posY) - 1, (int) - Math.floor(player.posZ)) - == net.minecraft.init.Blocks.air) { + if (player.worldObj.getBlock( + (int) Math.floor(player.posX), + (int) Math.floor(player.posY) - 1, + (int) Math.floor(player.posZ)) == net.minecraft.init.Blocks.air) { event.ammount *= 1 + (.25 * pounce); } @@ -130,10 +130,9 @@ public class ModEnchantmentHandler { if (event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; - int slowfall = - EnchantmentHelper.getMaxEnchantmentLevel(LibEnchantIDs.idSlowFall, player.inventory.armorInventory); - if (slowfall > 0 - && !event.entityLiving.isSneaking() + int slowfall = EnchantmentHelper + .getMaxEnchantmentLevel(LibEnchantIDs.idSlowFall, player.inventory.armorInventory); + if (slowfall > 0 && !event.entityLiving.isSneaking() && event.entityLiving.motionY < min && event.entityLiving.fallDistance >= 2.9) { event.entityLiving.motionY /= 1 + slowfall * 0.33F; @@ -166,8 +165,8 @@ public class ModEnchantmentHandler { public void onPlayerJump(LivingJumpEvent event) { if (event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; - int boost = EnchantmentHelper.getMaxEnchantmentLevel( - LibEnchantIDs.idAscentBoost, player.inventory.armorInventory); + int boost = EnchantmentHelper + .getMaxEnchantmentLevel(LibEnchantIDs.idAscentBoost, player.inventory.armorInventory); if (boost >= 1 && !player.isSneaking()) player.motionY *= (boost + 2) / 2D; } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantments.java b/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantments.java index c8c7f999..a885fa6e 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantments.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/ModEnchantments.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:57:55 (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.enchantment; import net.minecraft.enchantment.Enchantment; import net.minecraftforge.common.MinecraftForge; + import thaumic.tinkerer.common.lib.LibEnchantIDs; import thaumic.tinkerer.common.lib.LibEnchantNames; @@ -52,8 +50,8 @@ public final class ModEnchantments { finalStrike = new EnchantmentFinalStrike(LibEnchantIDs.finalStrike).setName(LibEnchantNames.finalStrike); - focusedStrike = - new EnchantmentFocusedStrikes(LibEnchantIDs.focusedStrike).setName(LibEnchantNames.focusedStrike); + focusedStrike = new EnchantmentFocusedStrikes(LibEnchantIDs.focusedStrike) + .setName(LibEnchantNames.focusedStrike); pounce = new EnchantmentPounce(LibEnchantIDs.pounce).setName(LibEnchantNames.pounce); shatter = new EnchantmentShatter(LibEnchantIDs.shatter).setName(LibEnchantNames.shatter); diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentData.java b/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentData.java index 0d66b747..88ecd93d 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentData.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentData.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 15:08:23 (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.enchantment.core; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.aspects.AspectList; public class EnchantmentData { diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentManager.java b/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentManager.java index 2897c311..2bcc06ab 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentManager.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/core/EnchantmentManager.java @@ -1,26 +1,23 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 15:05:23 (GMT)] */ package thaumic.tinkerer.common.enchantment.core; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Multimap; import java.util.HashMap; import java.util.List; import java.util.Map; + import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.Config; @@ -31,6 +28,9 @@ import thaumic.tinkerer.common.enchantment.ModEnchantments; import thaumic.tinkerer.common.enchantment.core.rule.BasicCompatibilityRule; import thaumic.tinkerer.common.lib.LibResearch; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; + public final class EnchantmentManager { public static final Map> enchantmentData = new HashMap(); @@ -80,7 +80,10 @@ public final class EnchantmentManager { new AspectList().add(Aspect.EARTH, 10).add(Aspect.ENTROPY, 12)); registerExponentialCostData( - Enchantment.sharpness, LibResources.ENCHANT_SHARPNESS, true, new AspectList().add(Aspect.ORDER, 10)); + Enchantment.sharpness, + LibResources.ENCHANT_SHARPNESS, + true, + new AspectList().add(Aspect.ORDER, 10)); registerExponentialCostData( Enchantment.smite, LibResources.ENCHANT_SMITE, @@ -105,13 +108,8 @@ public final class EnchantmentManager { Enchantment.looting, LibResources.ENCHANT_LOOTING, true, - new AspectList() - .add(Aspect.AIR, 10) - .add(Aspect.FIRE, 10) - .add(Aspect.WATER, 10) - .add(Aspect.EARTH, 10) - .add(Aspect.ORDER, 15) - .add(Aspect.ENTROPY, 15)); + new AspectList().add(Aspect.AIR, 10).add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.EARTH, 10) + .add(Aspect.ORDER, 15).add(Aspect.ENTROPY, 15)); registerExponentialCostData( Enchantment.efficiency, @@ -132,13 +130,8 @@ public final class EnchantmentManager { Enchantment.fortune, LibResources.ENCHANT_FORTUNE, true, - new AspectList() - .add(Aspect.AIR, 10) - .add(Aspect.FIRE, 10) - .add(Aspect.WATER, 10) - .add(Aspect.EARTH, 10) - .add(Aspect.ORDER, 15) - .add(Aspect.ENTROPY, 15)); + new AspectList().add(Aspect.AIR, 10).add(Aspect.FIRE, 10).add(Aspect.WATER, 10).add(Aspect.EARTH, 10) + .add(Aspect.ORDER, 15).add(Aspect.ENTROPY, 15)); registerExponentialCostData( Enchantment.power, @@ -181,13 +174,8 @@ public final class EnchantmentManager { Config.enchRepair, LibResources.ENCHANT_REPAIR, true, - new AspectList() - .add(Aspect.WATER, 20) - .add(Aspect.FIRE, 20) - .add(Aspect.EARTH, 20) - .add(Aspect.AIR, 20) - .add(Aspect.ORDER, 20) - .add(Aspect.ENTROPY, 5)); + new AspectList().add(Aspect.WATER, 20).add(Aspect.FIRE, 20).add(Aspect.EARTH, 20).add(Aspect.AIR, 20) + .add(Aspect.ORDER, 20).add(Aspect.ENTROPY, 5)); registerExponentialCostData( ModEnchantments.ascentBoost, @@ -289,9 +277,9 @@ public final class EnchantmentManager { } public static boolean canApply(ItemStack stack, Enchantment enchant, List currentEnchants) { - if (!enchant.canApply(stack) - || !enchant.type.canEnchantItem(stack.getItem()) - || currentEnchants.contains(enchant.effectId)) return false; + if (!enchant.canApply(stack) || !enchant.type.canEnchantItem(stack.getItem()) + || currentEnchants.contains(enchant.effectId)) + return false; for (IEnchantmentRule rule : rules.get(enchant.effectId)) if (rule.cantApplyAlongside(currentEnchants)) return false; @@ -306,16 +294,19 @@ public final class EnchantmentManager { return data.research.isEmpty() || ResearchManager.isResearchComplete(player, data.research); } - public static void registerExponentialCostData( - Enchantment enchantment, String texture, boolean vanilla, AspectList level1Aspects) { + public static void registerExponentialCostData(Enchantment enchantment, String texture, boolean vanilla, + AspectList level1Aspects) { registerExponentialCostData(enchantment, texture, vanilla, level1Aspects, ""); } - public static void registerExponentialCostData( - Enchantment enchantment, String texture, boolean vanilla, AspectList level1Aspects, String research) { + public static void registerExponentialCostData(Enchantment enchantment, String texture, boolean vanilla, + AspectList level1Aspects, String research) { for (double i = enchantment.getMinLevel(); i <= enchantment.getMaxLevel(); i++) { EnchantmentData data = new EnchantmentData( - texture, vanilla, MiscHelper.multiplyAspectList(level1Aspects, i * (1D + i * 0.2)), research); + texture, + vanilla, + MiscHelper.multiplyAspectList(level1Aspects, i * (1D + i * 0.2)), + research); registerData(enchantment.effectId, (int) i, data); } } @@ -328,13 +319,12 @@ public final class EnchantmentManager { private static void registerCompatibilityRules() { for (Enchantment ench : Enchantment.enchantmentsList) { - if (ench != null) - for (Enchantment ench1 : Enchantment.enchantmentsList) { - if (ench1 == null || ench == ench1) continue; + if (ench != null) for (Enchantment ench1 : Enchantment.enchantmentsList) { + if (ench1 == null || ench == ench1) continue; - if (!ench.canApplyTogether(ench1) || !ench1.canApplyTogether(ench)) - rules.put(ench.effectId, new BasicCompatibilityRule(ench1)); - } + if (!ench.canApplyTogether(ench1) || !ench1.canApplyTogether(ench)) + rules.put(ench.effectId, new BasicCompatibilityRule(ench1)); + } } } diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/core/IEnchantmentRule.java b/src/main/java/thaumic/tinkerer/common/enchantment/core/IEnchantmentRule.java index be51a1b1..0f27ede9 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/core/IEnchantmentRule.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/core/IEnchantmentRule.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 15:14:33 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/enchantment/core/rule/BasicCompatibilityRule.java b/src/main/java/thaumic/tinkerer/common/enchantment/core/rule/BasicCompatibilityRule.java index 8de63217..ee5de7b6 100644 --- a/src/main/java/thaumic/tinkerer/common/enchantment/core/rule/BasicCompatibilityRule.java +++ b/src/main/java/thaumic/tinkerer/common/enchantment/core/rule/BasicCompatibilityRule.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [14 Sep 2013, 15:15:33 (GMT)] @@ -15,7 +12,9 @@ package thaumic.tinkerer.common.enchantment.core.rule; import java.util.List; + import net.minecraft.enchantment.Enchantment; + import thaumic.tinkerer.common.enchantment.core.IEnchantmentRule; public class BasicCompatibilityRule implements IEnchantmentRule { diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemBlockFire.java b/src/main/java/thaumic/tinkerer/common/item/ItemBlockFire.java index d33abd44..16e0ad0e 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemBlockFire.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemBlockFire.java @@ -1,10 +1,12 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemBlock; import net.minecraft.util.IIcon; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.block.fire.*; import thaumic.tinkerer.common.registry.ITTinkererBlock; diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemBlockMagnet.java b/src/main/java/thaumic/tinkerer/common/item/ItemBlockMagnet.java index 5f6df0ae..01febed7 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemBlockMagnet.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemBlockMagnet.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:10:44 (GMT)] @@ -15,9 +12,11 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.lib.LibBlockNames; import thaumic.tinkerer.common.registry.ITTinkererItem; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemBloodSword.java b/src/main/java/thaumic/tinkerer/common/item/ItemBloodSword.java index c40c685e..f21ef6da 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemBloodSword.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemBloodSword.java @@ -1,25 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 24, 2013, 7:31:51 PM (GMT)] */ package thaumic.tinkerer.common.item; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -40,6 +33,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; + import thaumcraft.api.IRepairable; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; @@ -58,6 +52,13 @@ import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkererItem { private static final int DAMAGE = 10; @@ -78,8 +79,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer @Override public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { - return (stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) - ? activeIcon + return (stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) ? activeIcon : itemIcon; } @@ -119,8 +119,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer EntityPlayer player = (EntityPlayer) event.source.getEntity(); ItemStack stack = player.getCurrentEquippedItem(); - if (stack != null - && stack.getItem() == this + if (stack != null && stack.getItem() == this && stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) { Aspect[] aspects = EnumMobAspect.getAspectsForEntity(event.entity); @@ -177,12 +176,12 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer stack.stackTagCompound = new NBTTagCompound(); } if (stack.stackTagCompound.getInteger("Activated") == 0) { - par3EntityPlayer.addChatMessage( - new ChatComponentTranslation("ttmisc.bloodSword.activateEssentiaHarvest")); + par3EntityPlayer + .addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.activateEssentiaHarvest")); stack.stackTagCompound.setInteger("Activated", 1); } else { - par3EntityPlayer.addChatMessage( - new ChatComponentTranslation("ttmisc.bloodSword.deactivateEssentiaHarvest")); + par3EntityPlayer + .addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.deactivateEssentiaHarvest")); stack.stackTagCompound.setInteger("Activated", 0); } } @@ -212,23 +211,18 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_BLOOD_SWORD, - new AspectList() - .add(Aspect.HUNGER, 2) - .add(Aspect.WEAPON, 1) - .add(Aspect.FLESH, 1) - .add(Aspect.SOUL, 1), - -4, - 6, - 3, - new ItemStack(this)) - .setWarp(1) - .setParents(LibResearch.KEY_CLEANSING_TALISMAN) - .setPages( - new ResearchPage("0"), - ResearchHelper.infusionPage(LibResearch.KEY_BLOOD_SWORD), - new ResearchPage("1")) - .setSecondary(); + LibResearch.KEY_BLOOD_SWORD, + new AspectList().add(Aspect.HUNGER, 2).add(Aspect.WEAPON, 1).add(Aspect.FLESH, 1).add(Aspect.SOUL, 1), + -4, + 6, + 3, + new ItemStack(this)) + .setWarp(1).setParents(LibResearch.KEY_CLEANSING_TALISMAN) + .setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_BLOOD_SWORD), + new ResearchPage("1")) + .setSecondary(); } @Override @@ -237,11 +231,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable, ITTinkerer LibResearch.KEY_BLOOD_SWORD, new ItemStack(this), 6, - new AspectList() - .add(Aspect.HUNGER, 20) - .add(Aspect.DARKNESS, 5) - .add(Aspect.SOUL, 10) - .add(Aspect.MAN, 6), + new AspectList().add(Aspect.HUNGER, 20).add(Aspect.DARKNESS, 5).add(Aspect.SOUL, 10).add(Aspect.MAN, 6), new ItemStack(ConfigItems.itemSwordThaumium), new ItemStack(Items.rotten_flesh), new ItemStack(Items.porkchop), diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemBrightNitor.java b/src/main/java/thaumic/tinkerer/common/item/ItemBrightNitor.java index b7f263e5..71d83fcc 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemBrightNitor.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemBrightNitor.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [11 Sep 2013, 17:46:38 (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -44,8 +42,7 @@ public class ItemBrightNitor extends ItemBase { public static void setBlock(int x, int y, int z, World world) { if ((world.getBlock(x, y, z) == Blocks.air - || world.getBlock(x, y, z) - == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockNitorGas.class)) + || world.getBlock(x, y, z) == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockNitorGas.class)) && !world.isRemote) world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockNitorGas.class), meta, 2); } @@ -58,20 +55,17 @@ public class ItemBrightNitor extends ItemBase { @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_BRIGHT_NITOR, - new AspectList() - .add(Aspect.LIGHT, 2) - .add(Aspect.FIRE, 1) - .add(Aspect.ENERGY, 1) - .add(Aspect.AIR, 1), - 1, - -5, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_GASEOUS_LIGHT) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_BRIGHT_NITOR)) - .setSecondary(); + LibResearch.KEY_BRIGHT_NITOR, + new AspectList().add(Aspect.LIGHT, 2).add(Aspect.FIRE, 1).add(Aspect.ENERGY, 1).add(Aspect.AIR, 1), + 1, + -5, + 2, + new ItemStack(this)) + .setParents(LibResearch.KEY_GASEOUS_LIGHT).setConcealed() + .setPages( + new ResearchPage("0"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_BRIGHT_NITOR)) + .setSecondary(); } @Override @@ -80,11 +74,7 @@ public class ItemBrightNitor extends ItemBase { LibResearch.KEY_BRIGHT_NITOR, new ItemStack(this), new ItemStack(ConfigItems.itemResource, 1, 1), - new AspectList() - .add(Aspect.ENERGY, 25) - .add(Aspect.LIGHT, 25) - .add(Aspect.AIR, 10) - .add(Aspect.FIRE, 10)); + new AspectList().add(Aspect.ENERGY, 25).add(Aspect.LIGHT, 25).add(Aspect.AIR, 10).add(Aspect.FIRE, 10)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemCleansingTalisman.java b/src/main/java/thaumic/tinkerer/common/item/ItemCleansingTalisman.java index 4afcd53d..d9796bd4 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemCleansingTalisman.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemCleansingTalisman.java @@ -1,27 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [11 Sep 2013, 15:45:16 (GMT)] */ package thaumic.tinkerer.common.item; -import baubles.api.BaubleType; -import baubles.api.BaublesApi; -import baubles.api.IBauble; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Collection; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -33,7 +25,9 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import org.apache.commons.lang3.ArrayUtils; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -53,6 +47,12 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import baubles.api.BaubleType; +import baubles.api.BaublesApi; +import baubles.api.IBauble; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemCleansingTalisman extends ItemBase implements IBauble { @@ -98,18 +98,14 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble { @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_CLEANSING_TALISMAN, - new AspectList() - .add(Aspect.HEAL, 2) - .add(Aspect.ORDER, 1) - .add(Aspect.POISON, 1), - -3, - 4, - 3, - new ItemStack(this)) - .setSecondary() - .setParents(LibResearch.KEY_DARK_QUARTZ) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_CLEANSING_TALISMAN)); + LibResearch.KEY_CLEANSING_TALISMAN, + new AspectList().add(Aspect.HEAL, 2).add(Aspect.ORDER, 1).add(Aspect.POISON, 1), + -3, + 4, + 3, + new ItemStack(this)).setSecondary().setParents(LibResearch.KEY_DARK_QUARTZ).setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_CLEANSING_TALISMAN)); } @Override @@ -118,11 +114,7 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble { LibResearch.KEY_CLEANSING_TALISMAN, new ItemStack(this), 5, - new AspectList() - .add(Aspect.HEAL, 10) - .add(Aspect.TOOL, 10) - .add(Aspect.MAN, 20) - .add(Aspect.LIFE, 10), + new AspectList().add(Aspect.HEAL, 10).add(Aspect.TOOL, 10).add(Aspect.MAN, 20).add(Aspect.LIFE, 10), new ItemStack(Items.ender_pearl), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class)), @@ -169,39 +161,35 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble { if (player.isBurning()) { player.extinguish(); removed = true; - } else - for (PotionEffect potion : potions) { - int id = potion.getPotionID(); - boolean badEffect; - badEffect = ReflectionHelper.getPrivateValue( - Potion.class, Potion.potionTypes[id], new String[] {"isBadEffect", "field_76418_K" - }); - if (Potion.potionTypes[id] instanceof PotionWarpWard) { - badEffect = false; - } - if (badEffect) { - player.removePotionEffect(id); - removed = true; - int[] warpPotionIDs = new int[] { - Config.potionBlurredID, - Config.potionDeathGazeID, - Config.potionInfVisExhaustID, - Config.potionSunScornedID, - Config.potionUnHungerID - }; - if (ArrayUtils.contains(warpPotionIDs, potion.getPotionID())) { - damage = 10; - } - break; - } + } else for (PotionEffect potion : potions) { + int id = potion.getPotionID(); + boolean badEffect; + badEffect = ReflectionHelper.getPrivateValue( + Potion.class, + Potion.potionTypes[id], + new String[] { "isBadEffect", "field_76418_K" }); + if (Potion.potionTypes[id] instanceof PotionWarpWard) { + badEffect = false; } + if (badEffect) { + player.removePotionEffect(id); + removed = true; + int[] warpPotionIDs = new int[] { Config.potionBlurredID, Config.potionDeathGazeID, + Config.potionInfVisExhaustID, Config.potionSunScornedID, Config.potionUnHungerID }; + if (ArrayUtils.contains(warpPotionIDs, potion.getPotionID())) { + damage = 10; + } + break; + } + } if (removed) { par1ItemStack.damageItem(damage, player); if (par1ItemStack.getItemDamage() <= 0) { - BaublesApi.getBaubles((EntityPlayer) player) - .setInventorySlotContents(0, null); // Slot 0 = Talisman Slot + BaublesApi.getBaubles((EntityPlayer) player).setInventorySlotContents(0, null); // Slot 0 = + // Talisman + // Slot } par2World.playSoundAtEntity(player, "thaumcraft:wand", 0.3F, 0.1F); } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemConnector.java b/src/main/java/thaumic/tinkerer/common/item/ItemConnector.java index 955b47a9..9cc3007a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemConnector.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemConnector.java @@ -1,21 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 19:35:02 (GMT)] */ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -23,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigItems; @@ -37,6 +33,8 @@ import thaumic.tinkerer.common.registry.ItemBase; import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemConnector extends ItemBase { @@ -113,17 +111,8 @@ public class ItemConnector extends ItemBase { } @Override - public boolean onItemUse( - ItemStack par1ItemStack, - EntityPlayer par2EntityPlayer, - World par3World, - int par4, - int par5, - int par6, - int par7, - float par8, - float par9, - float par10) { + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, + int par5, int par6, int par7, float par8, float par9, float par10) { if (par3World.isRemote) return false; TileEntity tile = par3World.getTileEntity(par4, par5, par6); @@ -154,15 +143,13 @@ public class ItemConnector extends ItemBase { } else { TileTransvector trans = (TileTransvector) tile1; - if (tile != null - && tile1 instanceof TileTransvectorInterface + if (tile != null && tile1 instanceof TileTransvectorInterface && tile instanceof TileTransvectorInterface) { par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.interffail")); return true; } - if (Math.abs(x - par4) > trans.getMaxDistance() - || Math.abs(y - par5) > trans.getMaxDistance() + if (Math.abs(x - par4) > trans.getMaxDistance() || Math.abs(y - par5) > trans.getMaxDistance() || Math.abs(z - par6) > trans.getMaxDistance()) { par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.toofar")); return true; @@ -184,8 +171,8 @@ public class ItemConnector extends ItemBase { } @Override - public boolean itemInteractionForEntity( - ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { + public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, + EntityLivingBase par3EntityLivingBase) { par1ItemStack = par2EntityPlayer.getCurrentEquippedItem(); if (par2EntityPlayer.isSneaking()) { diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemGas.java b/src/main/java/thaumic/tinkerer/common/item/ItemGas.java index e93a188a..241b7985 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemGas.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemGas.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 22:12:14 (GMT)] @@ -15,10 +12,12 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -64,30 +63,26 @@ public class ItemGas extends ItemBase { public IRegisterableResearch getResearchItem() { if (setBlock == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousShadow.class)) { IRegisterableResearch research = (TTResearchItem) new TTResearchItem( - LibResearch.KEY_GASEOUS_SHADOW, - new AspectList() - .add(Aspect.DARKNESS, 2) - .add(Aspect.AIR, 1) - .add(Aspect.MOTION, 4), - -1, - -5, - 2, - new ItemStack(this)) - .setSecondary() - .setParents(LibResearch.KEY_GASEOUS_LIGHT) - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_GASEOUS_SHADOW)); + LibResearch.KEY_GASEOUS_SHADOW, + new AspectList().add(Aspect.DARKNESS, 2).add(Aspect.AIR, 1).add(Aspect.MOTION, 4), + -1, + -5, + 2, + new ItemStack(this)).setSecondary().setParents(LibResearch.KEY_GASEOUS_LIGHT).setPages( + new ResearchPage("0"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_GASEOUS_SHADOW)); return research; } if (setBlock == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class)) { IRegisterableResearch research = (TTResearchItem) new TTResearchItem( - LibResearch.KEY_GASEOUS_LIGHT, - new AspectList().add(Aspect.LIGHT, 2).add(Aspect.AIR, 1), - 0, - -3, - 1, - new ItemStack(this)) - .setParents("NITOR") - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_GASEOUS_LIGHT)); + LibResearch.KEY_GASEOUS_LIGHT, + new AspectList().add(Aspect.LIGHT, 2).add(Aspect.AIR, 1), + 0, + -3, + 1, + new ItemStack(this)).setParents("NITOR").setPages( + new ResearchPage("0"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_GASEOUS_LIGHT)); return research; } return null; @@ -107,10 +102,7 @@ public class ItemGas extends ItemBase { LibResearch.KEY_GASEOUS_SHADOW, new ItemStack(this), new ItemStack(ConfigItems.itemEssence, 1, 0), - new AspectList() - .add(Aspect.DARKNESS, 16) - .add(Aspect.AIR, 10) - .add(Aspect.MOTION, 8)); + new AspectList().add(Aspect.DARKNESS, 16).add(Aspect.AIR, 10).add(Aspect.MOTION, 8)); } return null; } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemGasRemover.java b/src/main/java/thaumic/tinkerer/common/item/ItemGasRemover.java index a3f2c1d9..e5cfb52d 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemGasRemover.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemGasRemover.java @@ -1,21 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 00:02:52 (GMT)] */ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -23,6 +18,7 @@ import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -37,6 +33,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemGasRemover extends ItemBase { @@ -54,15 +52,14 @@ public class ItemGasRemover extends ItemBase { public IRegisterableResearch getResearchItem() { IRegisterableResearch research = (TTResearchItem) new TTResearchItem( - LibResearch.KEY_GAS_REMOVER, - new AspectList().add(Aspect.DARKNESS, 2).add(Aspect.LIGHT, 2), - -2, - -7, - 0, - new ItemStack(this)) - .setRound() - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_GAS_REMOVER)) - .setParents(LibResearch.KEY_GASEOUS_SHADOW); + LibResearch.KEY_GAS_REMOVER, + new AspectList().add(Aspect.DARKNESS, 2).add(Aspect.LIGHT, 2), + -2, + -7, + 0, + new ItemStack(this)).setRound() + .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_GAS_REMOVER)) + .setParents(LibResearch.KEY_GASEOUS_SHADOW); return research; } @@ -79,11 +76,9 @@ public class ItemGasRemover extends ItemBase { 'D', new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemDarkQuartz.class)), 'T', - new ItemStack( - ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(0)), + new ItemStack(ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(0)), 'G', - new ItemStack( - ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(1)), + new ItemStack(ThaumicTinkerer.registry.getItemFromClass(ItemGas.class).get(1)), 'Q', new ItemStack(Items.quartz)); } @@ -96,15 +91,14 @@ public class ItemGasRemover extends ItemBase { int zs = (int) par3EntityPlayer.posZ; for (int x = xs - 3; x < xs + 3; x++) - for (int y = ys - 3; y < ys + 3; y++) - for (int z = zs - 3; z < zs + 3; z++) { - Block block = par2World.getBlock(x, y, z); - if (block != null && block instanceof BlockGas) { - BlockGas gas = (BlockGas) block; - gas.placeParticle(par2World, x, y, z); - par2World.setBlock(x, y, z, Blocks.air, 0, 1 | 2); - } + for (int y = ys - 3; y < ys + 3; y++) for (int z = zs - 3; z < zs + 3; z++) { + Block block = par2World.getBlock(x, y, z); + if (block != null && block instanceof BlockGas) { + BlockGas gas = (BlockGas) block; + gas.placeParticle(par2World, x, y, z); + par2World.setBlock(x, y, z, Blocks.air, 0, 1 | 2); } + } par2World.playSoundAtEntity(par3EntityPlayer, "thaumcraft.wand", 0.2F, 1F); } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedGrain.java b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedGrain.java index 9a5af92e..8e6481c4 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedGrain.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedGrain.java @@ -1,12 +1,14 @@ package thaumic.tinkerer.common.item; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IEssentiaContainerItem; @@ -92,10 +94,12 @@ public class ItemInfusedGrain extends ItemBase implements IEssentiaContainerItem public void setAspects(ItemStack itemStack, AspectList aspectList) {} private enum PRIMAL_ASPECT_ENUM { + AIR(Aspect.AIR), FIRE(Aspect.FIRE), EARTH(Aspect.EARTH), WATER(Aspect.WATER); + Aspect aspect; PRIMAL_ASPECT_ENUM(Aspect a) { diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedInkwell.java b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedInkwell.java index 3d3f2f89..32ef5121 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedInkwell.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedInkwell.java @@ -1,10 +1,9 @@ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; + import thaumcraft.api.IScribeTools; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -14,6 +13,8 @@ import thaumic.tinkerer.common.lib.LibItemNames; import thaumic.tinkerer.common.lib.LibResearch; import thaumic.tinkerer.common.registry.*; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemInfusedInkwell extends ItemBase implements IScribeTools { diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedPotion.java b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedPotion.java index 00c383aa..b7ff3799 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedPotion.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedPotion.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -11,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -137,45 +139,13 @@ public class ItemInfusedPotion extends ItemPotion implements ITTinkererItem { @Override public IRegisterableResearch getResearchItem() { - if (!ConfigHandler.enableFire) - return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_POTIONS, - new AspectList().add(Aspect.WATER, 5).add(Aspect.ENTROPY, 5), - 7, - -5, - 2, - ItemInfusedSeeds.getStackFromAspect(Aspect.FIRE)) - .setParentsHidden("INFUSION") - .setConcealed() - .setPages( - new ResearchPage("0"), - new ResearchPage("1"), - new ResearchPage("2"), - new ResearchPage("3"), - new ResearchPage("4"), - new ResearchPage("5"), - ResearchHelper.infusionPage(LibResearch.KEY_POTIONS, 4), - ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT0"), - ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT1"), - ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT2"), - ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT3")); - return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_POTIONS, - new AspectList().add(Aspect.WATER, 5).add(Aspect.ENTROPY, 5), - 7, - -5, - 2, - ItemInfusedSeeds.getStackFromAspect(Aspect.FIRE)) - .setParents( - LibResearch.KEY_FIRE_PERDITIO, - LibResearch.KEY_FIRE_ORDO, - LibResearch.KEY_FIRE_IGNIS, - LibResearch.KEY_FIRE_TERRA, - LibResearch.KEY_FIRE_AER, - LibResearch.KEY_FIRE_AQUA) - .setParentsHidden("INFUSION") - .setConcealed() - .setPages( + if (!ConfigHandler.enableFire) return (TTResearchItem) new TTResearchItem( + LibResearch.KEY_POTIONS, + new AspectList().add(Aspect.WATER, 5).add(Aspect.ENTROPY, 5), + 7, + -5, + 2, + ItemInfusedSeeds.getStackFromAspect(Aspect.FIRE)).setParentsHidden("INFUSION").setConcealed().setPages( new ResearchPage("0"), new ResearchPage("1"), new ResearchPage("2"), @@ -187,6 +157,32 @@ public class ItemInfusedPotion extends ItemPotion implements ITTinkererItem { ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT1"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT2"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT3")); + return (TTResearchItem) new TTResearchItem( + LibResearch.KEY_POTIONS, + new AspectList().add(Aspect.WATER, 5).add(Aspect.ENTROPY, 5), + 7, + -5, + 2, + ItemInfusedSeeds.getStackFromAspect(Aspect.FIRE)) + .setParents( + LibResearch.KEY_FIRE_PERDITIO, + LibResearch.KEY_FIRE_ORDO, + LibResearch.KEY_FIRE_IGNIS, + LibResearch.KEY_FIRE_TERRA, + LibResearch.KEY_FIRE_AER, + LibResearch.KEY_FIRE_AQUA) + .setParentsHidden("INFUSION").setConcealed().setPages( + new ResearchPage("0"), + new ResearchPage("1"), + new ResearchPage("2"), + new ResearchPage("3"), + new ResearchPage("4"), + new ResearchPage("5"), + ResearchHelper.infusionPage(LibResearch.KEY_POTIONS, 4), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT0"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT1"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT2"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_POTIONS + "POT3")); } @Override @@ -215,10 +211,12 @@ public class ItemInfusedPotion extends ItemPotion implements ITTinkererItem { } private enum PRIMAL_ASPECT_ENUM { + AIR(Aspect.AIR), FIRE(Aspect.FIRE), EARTH(Aspect.EARTH), WATER(Aspect.WATER); + Aspect aspect; PRIMAL_ASPECT_ENUM(Aspect a) { diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedSeeds.java b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedSeeds.java index 3052f5c7..7a63ee48 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemInfusedSeeds.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemInfusedSeeds.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.BlockFarmland; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -15,6 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigItems; @@ -132,8 +134,7 @@ public class ItemInfusedSeeds extends ItemSeeds implements ITTinkererItem { @Override public IIcon getIconIndex(ItemStack stack) { - return getAspect(stack) == null - ? icons[0] + return getAspect(stack) == null ? icons[0] : icons[BlockInfusedGrain.getNumberFromAspectForTexture(getAspect(stack))]; } @@ -238,31 +239,31 @@ public class ItemInfusedSeeds extends ItemSeeds implements ITTinkererItem { new ItemStack(ConfigItems.itemShard, 1, 5))); } - public boolean onItemUse( - ItemStack par1ItemStack, - EntityPlayer par2EntityPlayer, - World world, - int x, - int y, - int z, - int par7, - float par8, - float par9, - float par10) { + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World world, int x, int y, int z, + int par7, float par8, float par9, float par10) { if (par7 != 1) { return false; } else if (world.getBlock(x, y, z) instanceof BlockFarmland && par2EntityPlayer.canPlayerEdit(x, y, z, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(x, y + 1, z, par7, par1ItemStack)) { - world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedFarmland.class)); - world.setBlock(x, y + 1, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedGrain.class)); - BlockInfusedGrain.setAspect(world, x, y + 1, z, getAspect(par1ItemStack)); - ((TileInfusedGrain) world.getTileEntity(x, y + 1, z)).primalTendencies = getAspectTendencies(par1ItemStack); - par1ItemStack.stackSize--; - return true; - } else { - return false; - } + world.setBlock( + x, + y, + z, + ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedFarmland.class)); + world.setBlock( + x, + y + 1, + z, + ThaumicTinkerer.registry.getFirstBlockFromClass(BlockInfusedGrain.class)); + BlockInfusedGrain.setAspect(world, x, y + 1, z, getAspect(par1ItemStack)); + ((TileInfusedGrain) world.getTileEntity(x, y + 1, z)).primalTendencies = getAspectTendencies( + par1ItemStack); + par1ItemStack.stackSize--; + return true; + } else { + return false; + } } } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemMobAspect.java b/src/main/java/thaumic/tinkerer/common/item/ItemMobAspect.java index 547baa9e..5f2db78a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemMobAspect.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemMobAspect.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.item; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -8,6 +9,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -89,13 +91,12 @@ public class ItemMobAspect extends ItemBase { super.registerIcons(par1IconRegister); for (NumericAspectHelper aspect : NumericAspectHelper.values) { - aspectIcons[aspect.num] = IconHelper.forName( - par1IconRegister, aspect.getAspect().getName().toLowerCase()); - aspectIcons[aspect.num + aspectCount] = IconHelper.forName( - par1IconRegister, aspect.getAspect().getName().toLowerCase() + "_condensed"); + aspectIcons[aspect.num] = IconHelper.forName(par1IconRegister, aspect.getAspect().getName().toLowerCase()); + aspectIcons[aspect.num + aspectCount] = IconHelper + .forName(par1IconRegister, aspect.getAspect().getName().toLowerCase() + "_condensed"); - aspectIcons[aspect.num + 2 * aspectCount] = IconHelper.forName( - par1IconRegister, aspect.getAspect().getName().toLowerCase()); + aspectIcons[aspect.num + 2 * aspectCount] = IconHelper + .forName(par1IconRegister, aspect.getAspect().getName().toLowerCase()); } } @@ -121,25 +122,27 @@ public class ItemMobAspect extends ItemBase { ThaumcraftApi.registerObjectTag( new ItemStack(this, 1, i), - new int[] {i}, + new int[] { i }, new AspectList().add(NumericAspectHelper.getAspect(i), 8)); - recipeMulti.addRecipe(new ThaumicTinkererCraftingBenchRecipe( - LibResearch.KEY_SUMMON + "1", - new ItemStack(this, 1, i + 21), - "XXX", - "XXX", - "XXX", - 'X', - new ItemStack(this, 1, i))); + recipeMulti.addRecipe( + new ThaumicTinkererCraftingBenchRecipe( + LibResearch.KEY_SUMMON + "1", + new ItemStack(this, 1, i + 21), + "XXX", + "XXX", + "XXX", + 'X', + new ItemStack(this, 1, i))); ItemStack input = new ItemStack(this, 1, i + 21); - recipeMulti.addRecipe(new ThaumicTinkererInfusionRecipe( - LibResearch.KEY_SUMMON, - new ItemStack(this, 1, i + 42), - 4, - new AspectList().add(getAspect(new ItemStack(this, 1, i)), 10), - input, - new ItemStack[] {input, input, input, input, input, input, input, input})); + recipeMulti.addRecipe( + new ThaumicTinkererInfusionRecipe( + LibResearch.KEY_SUMMON, + new ItemStack(this, 1, i + 42), + 4, + new AspectList().add(getAspect(new ItemStack(this, 1, i)), 10), + input, + new ItemStack[] { input, input, input, input, input, input, input, input })); } return recipeMulti; } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemMobDisplay.java b/src/main/java/thaumic/tinkerer/common/item/ItemMobDisplay.java index 5d04979e..c3c9922b 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemMobDisplay.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemMobDisplay.java @@ -1,10 +1,12 @@ package thaumic.tinkerer.common.item; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityList; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.core.helper.EnumMobAspect; import thaumic.tinkerer.common.core.helper.ItemNBTHelper; import thaumic.tinkerer.common.lib.LibItemNames; @@ -16,13 +18,14 @@ import thaumic.tinkerer.common.research.IRegisterableResearch; * Created by Katrina on 11/03/14. */ public class ItemMobDisplay extends ItemBase { + public static final String TAG_TYPE = "type"; public ItemMobDisplay() { super(); setHasSubtypes(true); // This allows the item to be marked as a metadata item. - setMaxDamage( - 0); // This makes it so your item doesn't have the damage bar at the bottom of its icon, when "damaged" + setMaxDamage(0); // This makes it so your item doesn't have the damage bar at the bottom of its icon, when + // "damaged" // similar to the Tools. } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemRevealingHelm.java b/src/main/java/thaumic/tinkerer/common/item/ItemRevealingHelm.java index eae7b3af..802405f4 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemRevealingHelm.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemRevealingHelm.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 25, 2013, 8:52:43 PM (GMT)] */ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -30,6 +26,7 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.IGoggles; import thaumcraft.api.IRepairable; import thaumcraft.api.IRunicArmor; @@ -51,6 +48,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemRevealingHelm extends ItemArmor implements IRepairable, IRevealer, IGoggles, IVisDiscountGear, IRunicArmor, ITTinkererItem { @@ -80,8 +79,11 @@ public class ItemRevealingHelm extends ItemArmor @Override public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean par4) { - list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " - + this.getVisDiscount(stack, player, null) + "%"); + list.add( + EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + + ": " + + this.getVisDiscount(stack, player, null) + + "%"); } @Override @@ -134,14 +136,12 @@ public class ItemRevealingHelm extends ItemArmor public IRegisterableResearch getResearchItem() { IRegisterableResearch research; research = (TTResearchItem) new TTResearchItem( - LibResearch.KEY_REVEALING_HELM, - new AspectList().add(Aspect.AURA, 2).add(Aspect.ARMOR, 1), - 0, - 0, - 1, - new ItemStack(this)) - .setParents("GOGGLES") - .setParentsHidden("THAUMIUM"); + LibResearch.KEY_REVEALING_HELM, + new AspectList().add(Aspect.AURA, 2).add(Aspect.ARMOR, 1), + 0, + 0, + 1, + new ItemStack(this)).setParents("GOGGLES").setParentsHidden("THAUMIUM"); ((TTResearchItem) research) .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_REVEALING_HELM)); return research; @@ -153,13 +153,8 @@ public class ItemRevealingHelm extends ItemArmor LibResearch.KEY_REVEALING_HELM, LibResearch.KEY_REVEALING_HELM, new ItemStack(this), - new AspectList() - .add(Aspect.EARTH, 5) - .add(Aspect.FIRE, 5) - .add(Aspect.WATER, 5) - .add(Aspect.AIR, 5) - .add(Aspect.ORDER, 5) - .add(Aspect.ENTROPY, 5), + new AspectList().add(Aspect.EARTH, 5).add(Aspect.FIRE, 5).add(Aspect.WATER, 5).add(Aspect.AIR, 5) + .add(Aspect.ORDER, 5).add(Aspect.ENTROPY, 5), "GH", 'G', new ItemStack(ConfigItems.itemGoggles), @@ -168,21 +163,11 @@ public class ItemRevealingHelm extends ItemArmor } @Override - public boolean onItemUse( - ItemStack p_77648_1_, - EntityPlayer p_77648_2_, - World p_77648_3_, - int p_77648_4_, - int p_77648_5_, - int p_77648_6_, - int p_77648_7_, - float p_77648_8_, - float p_77648_9_, - float p_77648_10_) { + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, + int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { TileEntity tile = p_77648_3_.getTileEntity(p_77648_4_, p_77648_5_, p_77648_6_); if (tile != null) - p_77648_2_.addChatComponentMessage( - new ChatComponentText("Tile Entity: " + tile.getClass().toString())); + p_77648_2_.addChatComponentMessage(new ChatComponentText("Tile Entity: " + tile.getClass().toString())); else p_77648_2_.addChatComponentMessage(new ChatComponentText("Tile Entity: null")); return super.onItemUse( p_77648_1_, diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemShareBook.java b/src/main/java/thaumic/tinkerer/common/item/ItemShareBook.java index b8dc29a5..f1805279 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemShareBook.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemShareBook.java @@ -1,9 +1,8 @@ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; @@ -15,6 +14,7 @@ import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; import thaumcraft.common.config.ConfigItems; @@ -30,6 +30,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemShareBook extends ItemBase { @@ -48,15 +50,16 @@ public class ItemShareBook extends ItemBase { @Override public IRegisterableResearch getResearchItem() { - IRegisterableResearch research = (TTResearchItem) - new TTResearchItem(LibResearch.KEY_SHARE_TOME, new AspectList(), 0, -1, 0, new ItemStack(this)) - .setStub() - .setAutoUnlock() - .setRound(); - if (ConfigHandler.enableSurvivalShareTome) - ((TTResearchItem) research) - .setPages(new ResearchPage("0"), ResearchHelper.recipePage(LibResearch.KEY_SHARE_TOME)); - else ((TTResearchItem) research).setPages(new ResearchPage("0")); + IRegisterableResearch research = (TTResearchItem) new TTResearchItem( + LibResearch.KEY_SHARE_TOME, + new AspectList(), + 0, + -1, + 0, + new ItemStack(this)).setStub().setAutoUnlock().setRound(); + if (ConfigHandler.enableSurvivalShareTome) ((TTResearchItem) research) + .setPages(new ResearchPage("0"), ResearchHelper.recipePage(LibResearch.KEY_SHARE_TOME)); + else((TTResearchItem) research).setPages(new ResearchPage("0")); return research; } @@ -87,26 +90,24 @@ public class ItemShareBook extends ItemBase { setPlayerResearch(par1ItemStack, par3EntityPlayer.getGameProfile().getName()); if (!par2World.isRemote) par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.write")); - } else - sync: - { - List researchesDone = ResearchManager.getResearchForPlayer(name); + } else sync: { + List researchesDone = ResearchManager.getResearchForPlayer(name); - if (researchesDone == null) { - if (par2World.isRemote) researchesDone = getPlayerResearch(par1ItemStack); - else { - par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync")); - break sync; - } - } - - for (String key : researchesDone) - ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(par3EntityPlayer, key); - - if (!par2World.isRemote) + if (researchesDone == null) { + if (par2World.isRemote) researchesDone = getPlayerResearch(par1ItemStack); + else { par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync")); + break sync; + } } + for (String key : researchesDone) + ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(par3EntityPlayer, key); + + if (!par2World.isRemote) + par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync")); + } + return par1ItemStack; } @@ -133,8 +134,7 @@ public class ItemShareBook extends ItemBase { public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { String name = getPlayerName(par1ItemStack); par3List.add( - name.equals(NON_ASIGNED) - ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign") + name.equals(NON_ASIGNED) ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign") : String.format(StatCollector.translateToLocal("ttmisc.shareTome.playerName"), name)); } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemSoulMould.java b/src/main/java/thaumic/tinkerer/common/item/ItemSoulMould.java index b87e81ba..1f770662 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemSoulMould.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemSoulMould.java @@ -1,22 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 17:36:35 (GMT)] */ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -24,6 +20,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumic.tinkerer.common.core.helper.ItemNBTHelper; @@ -33,6 +30,8 @@ import thaumic.tinkerer.common.registry.ItemBase; import thaumic.tinkerer.common.registry.ThaumicTinkererCrucibleRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemSoulMould extends ItemBase { @@ -74,8 +73,8 @@ public class ItemSoulMould extends ItemBase { } @Override - public boolean itemInteractionForEntity( - ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { + public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, + EntityLivingBase par3EntityLivingBase) { if (par3EntityLivingBase instanceof EntityPlayer) return true; if (par2EntityPlayer != null) setPattern(par2EntityPlayer.getCurrentEquippedItem(), par3EntityLivingBase); else setPattern(par1ItemStack, par3EntityLivingBase); @@ -95,10 +94,10 @@ public class ItemSoulMould extends ItemBase { String name = getPatternName(par1ItemStack); if (name.isEmpty()) par3List.add(StatCollector.translateToLocal("ttmisc.soulMould.nonAssigned")); - else - par3List.add(String.format( - StatCollector.translateToLocal("ttmisc.soulMould.pattern"), - StatCollector.translateToLocal("entity." + name + ".name"))); + else par3List.add( + String.format( + StatCollector.translateToLocal("ttmisc.soulMould.pattern"), + StatCollector.translateToLocal("entity." + name + ".name"))); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemSpellCloth.java b/src/main/java/thaumic/tinkerer/common/item/ItemSpellCloth.java index b874ad6d..0a79b5b6 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemSpellCloth.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemSpellCloth.java @@ -1,27 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 01:20:22 (GMT)] */ package thaumic.tinkerer.common.item; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.awt.*; + import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.oredict.RecipeSorter; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -35,6 +32,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemSpellCloth extends ItemBase { @@ -61,14 +60,14 @@ public class ItemSpellCloth extends ItemBase { public IRegisterableResearch getResearchItem() { IRegisterableResearch research = (TTResearchItem) new TTResearchItem( - LibResearch.KEY_SPELL_CLOTH, - new AspectList().add(Aspect.MAGIC, 2).add(Aspect.CLOTH, 1), - 3, - 2, - 2, - new ItemStack(this)) - .setParentsHidden("ENCHFABRIC") - .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_SPELL_CLOTH)); + LibResearch.KEY_SPELL_CLOTH, + new AspectList().add(Aspect.MAGIC, 2).add(Aspect.CLOTH, 1), + 3, + 2, + 2, + new ItemStack(this)).setParentsHidden("ENCHFABRIC").setPages( + new ResearchPage("0"), + ResearchHelper.crucibleRecipePage(LibResearch.KEY_SPELL_CLOTH)); return research; } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemTravelSlab.java b/src/main/java/thaumic/tinkerer/common/item/ItemTravelSlab.java index de7d30c5..8ae0892f 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemTravelSlab.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemTravelSlab.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.item.ItemSlab; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockTravelSlab; import thaumic.tinkerer.common.lib.LibBlockNames; @@ -20,9 +22,7 @@ public class ItemTravelSlab extends ItemSlab implements ITTinkererItem { super( par1, (BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockTravelSlab.class), - (BlockSlab) ThaumicTinkerer.registry - .getBlockFromClass(BlockTravelSlab.class) - .get(1), + (BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockTravelSlab.class).get(1), false); } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemWardSlab.java b/src/main/java/thaumic/tinkerer/common/item/ItemWardSlab.java index b45970ed..7359a0df 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemWardSlab.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemWardSlab.java @@ -1,9 +1,11 @@ package thaumic.tinkerer.common.item; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.item.ItemSlab; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockWardSlab; import thaumic.tinkerer.common.lib.LibBlockNames; @@ -20,9 +22,7 @@ public class ItemWardSlab extends ItemSlab implements ITTinkererItem { super( par1, (BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWardSlab.class), - (BlockSlab) ThaumicTinkerer.registry - .getBlockFromClass(BlockWardSlab.class) - .get(1), + (BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockWardSlab.class).get(1), false); } diff --git a/src/main/java/thaumic/tinkerer/common/item/ItemXPTalisman.java b/src/main/java/thaumic/tinkerer/common/item/ItemXPTalisman.java index a3279300..094f6d9d 100644 --- a/src/main/java/thaumic/tinkerer/common/item/ItemXPTalisman.java +++ b/src/main/java/thaumic/tinkerer/common/item/ItemXPTalisman.java @@ -1,24 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [28 Sep 2013, 18:27:56 (GMT)] */ package thaumic.tinkerer.common.item; -import baubles.api.BaubleType; -import baubles.api.IBauble; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityXPOrb; @@ -30,6 +24,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -46,6 +41,10 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import baubles.api.BaubleType; +import baubles.api.IBauble; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemXPTalisman extends ItemBase implements IBauble { @@ -81,16 +80,16 @@ public class ItemXPTalisman extends ItemBase implements IBauble { boolean has = par3EntityPlayer.inventory.consumeInventoryItem(Items.glass_bottle); if (has) { if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Items.experience_bottle, 1)) - && !par2World.isRemote) par3EntityPlayer.dropItem(Items.experience_bottle, 1); + && !par2World.isRemote) + par3EntityPlayer.dropItem(Items.experience_bottle, 1); int xp = getXP(par1ItemStack); setXP(par1ItemStack, xp - LibFeatures.XP_TALISMAN_ENCHANTING_BOTTLE_COST); par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.1F, (float) (0.1F + Math.random() / 2F)); - for (int i = 0; par2World.isRemote && i < 6; i++) - ThaumicTinkerer.tcProxy.sparkle( - (float) (par3EntityPlayer.posX + (Math.random() - 0.5)), - (float) (par3EntityPlayer.posY + Math.random() - 0.5), - (float) (par3EntityPlayer.posZ + (Math.random() - 0.5)), - 3); + for (int i = 0; par2World.isRemote && i < 6; i++) ThaumicTinkerer.tcProxy.sparkle( + (float) (par3EntityPlayer.posX + (Math.random() - 0.5)), + (float) (par3EntityPlayer.posY + Math.random() - 0.5), + (float) (par3EntityPlayer.posZ + (Math.random() - 0.5)), + 3); } } @@ -100,8 +99,8 @@ public class ItemXPTalisman extends ItemBase implements IBauble { private void consumeXPOrb(EntityXPOrb orb) { orb.setDead(); orb.worldObj.playSoundAtEntity(orb, "thaumcraft:zap", orb.getXpValue() / 10F, 1F); - ThaumicTinkerer.tcProxy.wispFX( - orb.worldObj, orb.posX, orb.posY, orb.posZ, orb.getXpValue() / 5F, 0.1F, 0.9F, 0.1F); + ThaumicTinkerer.tcProxy + .wispFX(orb.worldObj, orb.posX, orb.posY, orb.posZ, orb.getXpValue() / 5F, 0.1F, 0.9F, 0.1F); } @Override @@ -135,19 +134,14 @@ public class ItemXPTalisman extends ItemBase implements IBauble { @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_XP_TALISMAN, - new AspectList() - .add(Aspect.GREED, 1) - .add(Aspect.MAGIC, 1) - .add(Aspect.MAN, 1), - 4, - -1, - 2, - new ItemStack(this, 1, 1)) - .setParents("JARBRAIN", LibResearch.KEY_SPELL_CLOTH) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_XP_TALISMAN)) - .setSecondary(); + LibResearch.KEY_XP_TALISMAN, + new AspectList().add(Aspect.GREED, 1).add(Aspect.MAGIC, 1).add(Aspect.MAN, 1), + 4, + -1, + 2, + new ItemStack(this, 1, 1)).setParents("JARBRAIN", LibResearch.KEY_SPELL_CLOTH).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_XP_TALISMAN)) + .setSecondary(); } @Override @@ -156,10 +150,7 @@ public class ItemXPTalisman extends ItemBase implements IBauble { LibResearch.KEY_XP_TALISMAN, new ItemStack(this), 6, - new AspectList() - .add(Aspect.GREED, 20) - .add(Aspect.EXCHANGE, 10) - .add(Aspect.BEAST, 10) + new AspectList().add(Aspect.GREED, 20).add(Aspect.EXCHANGE, 10).add(Aspect.BEAST, 10) .add(Aspect.MECHANISM, 5), new ItemStack(Items.gold_ingot), new ItemStack(Items.quartz), diff --git a/src/main/java/thaumic/tinkerer/common/item/SpellClothCraftingHandler.java b/src/main/java/thaumic/tinkerer/common/item/SpellClothCraftingHandler.java index bf921356..b950f5f4 100644 --- a/src/main/java/thaumic/tinkerer/common/item/SpellClothCraftingHandler.java +++ b/src/main/java/thaumic/tinkerer/common/item/SpellClothCraftingHandler.java @@ -1,11 +1,12 @@ package thaumic.tinkerer.common.item; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.api.INoRemoveEnchant; import thaumic.tinkerer.common.ThaumicTinkerer; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; /** * Created by Katrina on 07/03/2015. diff --git a/src/main/java/thaumic/tinkerer/common/item/SpellClothRecipe.java b/src/main/java/thaumic/tinkerer/common/item/SpellClothRecipe.java index 79fbaeda..519a22e1 100644 --- a/src/main/java/thaumic/tinkerer/common/item/SpellClothRecipe.java +++ b/src/main/java/thaumic/tinkerer/common/item/SpellClothRecipe.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 01:20:26 (GMT)] @@ -20,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; + import thaumic.tinkerer.api.INoRemoveEnchant; public class SpellClothRecipe implements IRecipe { diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDeflect.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDeflect.java index b5172c79..63c37270 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDeflect.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDeflect.java @@ -1,28 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 8, 2013, 6:26:09 PM (GMT)] */ package thaumic.tinkerer.common.item.foci; -import cpw.mods.fml.common.Loader; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.IProjectile; import net.minecraft.entity.item.EntityExpBottle; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -44,12 +42,12 @@ import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; import vazkii.botania.api.internal.IManaBurst; +import cpw.mods.fml.common.Loader; public class ItemFocusDeflect extends ItemModFocus { public static List> DeflectBlacklist = new ArrayList>(); - private static final AspectList visUsage = - new AspectList().add(Aspect.ORDER, 8).add(Aspect.AIR, 4); + private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 8).add(Aspect.AIR, 4); public static void setupBlackList() { DeflectBlacklist.add(EntityExpBottle.class); @@ -77,10 +75,9 @@ public class ItemFocusDeflect extends ItemModFocus { for (Entity e : projectiles) { if (CheckBlackList(e) || ProjectileHelper.getOwner(e) == p) continue; - Vector3 motionVec = new Vector3(e.motionX, e.motionY, e.motionZ) - .normalize() - .multiply(Math.sqrt((e.posX - p.posX) * (e.posX - p.posX) - + (e.posY - p.posY) * (e.posY - p.posY) + Vector3 motionVec = new Vector3(e.motionX, e.motionY, e.motionZ).normalize().multiply( + Math.sqrt( + (e.posX - p.posX) * (e.posX - p.posX) + (e.posY - p.posY) * (e.posY - p.posY) + (e.posZ - p.posZ) * (e.posZ - p.posZ)) * 2); @@ -97,15 +94,15 @@ public class ItemFocusDeflect extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.enlarge}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.enlarge}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; } return null; } @@ -159,20 +156,14 @@ public class ItemFocusDeflect extends ItemModFocus { return null; } return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_DEFLECT, - new AspectList() - .add(Aspect.MOTION, 2) - .add(Aspect.AIR, 1) - .add(Aspect.ORDER, 1) - .add(Aspect.DEATH, 1), - -4, - -3, - 3, - new ItemStack(this)) - .setConcealed() - .setParents(LibResearch.KEY_FOCUS_SMELT) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_DEFLECT)) - .setSecondary(); + LibResearch.KEY_FOCUS_DEFLECT, + new AspectList().add(Aspect.MOTION, 2).add(Aspect.AIR, 1).add(Aspect.ORDER, 1).add(Aspect.DEATH, 1), + -4, + -3, + 3, + new ItemStack(this)).setConcealed().setParents(LibResearch.KEY_FOCUS_SMELT) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_DEFLECT)) + .setSecondary(); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDislocation.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDislocation.java index 19a75421..b5994f9b 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDislocation.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusDislocation.java @@ -1,22 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 22:19:25 (GMT)] */ package thaumic.tinkerer.common.item.foci; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -30,6 +26,7 @@ import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -49,6 +46,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemFocusDislocation extends ItemModFocus { @@ -60,12 +59,12 @@ public class ItemFocusDislocation extends ItemModFocus { private static final String TAG_BLOCK_NAME = "blockName"; private static final String TAG_BLOCK_META = "blockMeta"; - private static final AspectList visUsage = - new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.ORDER, 500).add(Aspect.EARTH, 100); - private static final AspectList visUsageTile = - new AspectList().add(Aspect.ENTROPY, 2500).add(Aspect.ORDER, 2500).add(Aspect.EARTH, 500); - private static final AspectList visUsageSpawner = - new AspectList().add(Aspect.ENTROPY, 10000).add(Aspect.ORDER, 10000).add(Aspect.EARTH, 5000); + private static final AspectList visUsage = new AspectList().add(Aspect.ENTROPY, 500).add(Aspect.ORDER, 500) + .add(Aspect.EARTH, 100); + private static final AspectList visUsageTile = new AspectList().add(Aspect.ENTROPY, 2500).add(Aspect.ORDER, 2500) + .add(Aspect.EARTH, 500); + private static final AspectList visUsageSpawner = new AspectList().add(Aspect.ENTROPY, 10000) + .add(Aspect.ORDER, 10000).add(Aspect.EARTH, 5000); private static ArrayList blacklist = new ArrayList(); private IIcon ornament; @@ -89,8 +88,8 @@ public class ItemFocusDislocation extends ItemModFocus { } @Override - public ItemStack onFocusRightClick( - ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition mop) { + public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer player, + MovingObjectPosition mop) { if (mop == null) return itemstack; Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ); @@ -117,9 +116,8 @@ public class ItemFocusDislocation extends ItemModFocus { ((ItemBlock) stack.getItem()).field_150939_a, stack.getItemDamage(), 1 | 2); - ((ItemBlock) stack.getItem()) - .field_150939_a.onBlockPlacedBy( - world, mop.blockX, mop.blockY, mop.blockZ, player, itemstack); + ((ItemBlock) stack.getItem()).field_150939_a + .onBlockPlacedBy(world, mop.blockX, mop.blockY, mop.blockZ, player, itemstack); NBTTagCompound tileCmp = getStackTileEntity(itemstack); if (tileCmp != null && !tileCmp.hasNoTags()) { TileEntity tile1 = TileEntity.createAndLoadEntity(tileCmp); @@ -139,29 +137,28 @@ public class ItemFocusDislocation extends ItemModFocus { } world.playSoundAtEntity(player, "thaumcraft:wand", 0.5F, 1F); } - } else if (!blacklist.contains(block) - && isBlockAllowed(block) + } else if (!blacklist.contains(block) && isBlockAllowed(block) && !ThaumcraftApi.portableHoleBlackList.contains(block) && block != null && block.getBlockHardness(world, mop.blockX, mop.blockY, mop.blockZ) != -1F && wand.consumeAllVis(itemstack, player, getCost(tile), true, false)) { - if (!world.isRemote) { - world.removeTileEntity(mop.blockX, mop.blockY, mop.blockZ); - world.setBlock(mop.blockX, mop.blockY, mop.blockZ, Blocks.air, 0, 1 | 2); - storePickedBlock(itemstack, block, (short) meta, tile); - } + if (!world.isRemote) { + world.removeTileEntity(mop.blockX, mop.blockY, mop.blockZ); + world.setBlock(mop.blockX, mop.blockY, mop.blockZ, Blocks.air, 0, 1 | 2); + storePickedBlock(itemstack, block, (short) meta, tile); + } - for (int i = 0; i < 8; i++) { - float x = (float) (mop.blockX + Math.random()); - float y = (float) (mop.blockY + Math.random()); - float z = (float) (mop.blockZ + Math.random()); - ThaumicTinkerer.tcProxy.burst(world, x, y, z, 0.2F); - } - world.playSoundAtEntity(player, block.stepSound.getBreakSound(), 1F, 1F); - world.playSoundAtEntity(player, "thaumcraft:wand", 0.5F, 1F); + for (int i = 0; i < 8; i++) { + float x = (float) (mop.blockX + Math.random()); + float y = (float) (mop.blockY + Math.random()); + float z = (float) (mop.blockZ + Math.random()); + ThaumicTinkerer.tcProxy.burst(world, x, y, z, 0.2F); + } + world.playSoundAtEntity(player, block.stepSound.getBreakSound(), 1F, 1F); + world.playSoundAtEntity(player, "thaumcraft:wand", 0.5F, 1F); - if (world.isRemote) player.swingItem(); - } + if (world.isRemote) player.swingItem(); + } } return itemstack; @@ -212,7 +209,7 @@ public class ItemFocusDislocation extends ItemModFocus { ItemStack stck; // if(block instanceof BlockReed) // { - // stck=new ItemStack(Items.reeds,1,meta); + // stck=new ItemStack(Items.reeds,1,meta); // } stck = new ItemStack(new ItemBlock(block), 1, meta); return stck; @@ -268,15 +265,15 @@ public class ItemFocusDislocation extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; } return null; } @@ -297,19 +294,12 @@ public class ItemFocusDislocation extends ItemModFocus { return null; } return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_DISLOCATION, - new AspectList() - .add(Aspect.ELDRITCH, 2) - .add(Aspect.MAGIC, 1) - .add(Aspect.EXCHANGE, 1), - -5, - -5, - 2, - new ItemStack(this)) - .setSecondary() - .setParents(LibResearch.KEY_FOCUS_FLIGHT) - .setConcealed() - .setPages( + LibResearch.KEY_FOCUS_DISLOCATION, + new AspectList().add(Aspect.ELDRITCH, 2).add(Aspect.MAGIC, 1).add(Aspect.EXCHANGE, 1), + -5, + -5, + 2, + new ItemStack(this)).setSecondary().setParents(LibResearch.KEY_FOCUS_FLIGHT).setConcealed().setPages( new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_DISLOCATION)); @@ -321,12 +311,8 @@ public class ItemFocusDislocation extends ItemModFocus { LibResearch.KEY_FOCUS_DISLOCATION, new ItemStack(this), 8, - new AspectList() - .add(Aspect.ELDRITCH, 20) - .add(Aspect.DARKNESS, 10) - .add(Aspect.VOID, 25) - .add(Aspect.MAGIC, 20) - .add(Aspect.TAINT, 5), + new AspectList().add(Aspect.ELDRITCH, 20).add(Aspect.DARKNESS, 10).add(Aspect.VOID, 25) + .add(Aspect.MAGIC, 20).add(Aspect.TAINT, 5), new ItemStack(Items.ender_pearl), new ItemStack(Items.quartz), new ItemStack(Items.quartz), diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusEnderChest.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusEnderChest.java index 1600f089..33a192fb 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusEnderChest.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusEnderChest.java @@ -1,26 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Nov 24, 2013, 2:49:01 PM (GMT)] */ package thaumic.tinkerer.common.item.foci; -import cpw.mods.fml.common.Loader; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -37,11 +35,11 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; +import cpw.mods.fml.common.Loader; public class ItemFocusEnderChest extends ItemModFocus { - public static final AspectList visUsage = - new AspectList().add(Aspect.ENTROPY, 100).add(Aspect.ORDER, 100); + public static final AspectList visUsage = new AspectList().add(Aspect.ENTROPY, 100).add(Aspect.ORDER, 100); @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { @@ -93,15 +91,15 @@ public class ItemFocusEnderChest extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; } return null; } @@ -118,26 +116,20 @@ public class ItemFocusEnderChest extends ItemModFocus { return null; } IRegisterableResearch research = (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_ENDER_CHEST, - new AspectList() - .add(Aspect.ELDRITCH, 2) - .add(Aspect.VOID, 1) - .add(Aspect.MAGIC, 1), - -6, - -2, - 2, - new ItemStack(this)) - .setWarp(1) - .setParents(LibResearch.KEY_FOCUS_DEFLECT) - .setConcealed(); + LibResearch.KEY_FOCUS_ENDER_CHEST, + new AspectList().add(Aspect.ELDRITCH, 2).add(Aspect.VOID, 1).add(Aspect.MAGIC, 1), + -6, + -2, + 2, + new ItemStack(this)).setWarp(1).setParents(LibResearch.KEY_FOCUS_DEFLECT).setConcealed(); if (Loader.isModLoaded("EnderStorage")) { - ((TTResearchItem) research) - .setPages( - new ResearchPage("ES"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FOCUS_ENDER_CHEST)); + ((TTResearchItem) research).setPages( + new ResearchPage("ES"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_FOCUS_ENDER_CHEST)); } else { - ((TTResearchItem) research) - .setPages( - new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FOCUS_ENDER_CHEST)); + ((TTResearchItem) research).setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_FOCUS_ENDER_CHEST)); } return research; } diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusFlight.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusFlight.java index c1214b16..62f9c97d 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusFlight.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusFlight.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 19:27:13 (GMT)] @@ -21,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -42,8 +40,8 @@ public class ItemFocusFlight extends ItemModFocus { private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 15); @Override - public ItemStack onFocusRightClick( - ItemStack itemstack, World world, EntityPlayer p, MovingObjectPosition movingobjectposition) { + public ItemStack onFocusRightClick(ItemStack itemstack, World world, EntityPlayer p, + MovingObjectPosition movingobjectposition) { ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); if (!ConfigHandler.enableFlight) { return itemstack; @@ -58,16 +56,15 @@ public class ItemFocusFlight extends ItemModFocus { if (p instanceof EntityPlayerMP) { ((EntityPlayerMP) p).playerNetServerHandler.floatingTickCount = 0; } - for (int i = 0; i < 5; i++) - ThaumicTinkerer.tcProxy.smokeSpiral( - world, - p.posX, - p.posY - p.motionY, - p.posZ, - 2F, - (int) (Math.random() * 360), - (int) p.posY, - 0x9E2FF); + for (int i = 0; i < 5; i++) ThaumicTinkerer.tcProxy.smokeSpiral( + world, + p.posX, + p.posY - p.motionY, + p.posZ, + 2F, + (int) (Math.random() * 360), + (int) p.posY, + 0x9E2FF); world.playSoundAtEntity(p, "thaumcraft:wind", 0.4F, 1F); } @@ -99,15 +96,15 @@ public class ItemFocusFlight extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; } return null; } @@ -120,18 +117,13 @@ public class ItemFocusFlight extends ItemModFocus { @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_FLIGHT, - new AspectList() - .add(Aspect.MOTION, 1) - .add(Aspect.MAGIC, 1) - .add(Aspect.AIR, 2), - -3, - -4, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_FOCUS_SMELT) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_FLIGHT)); + LibResearch.KEY_FOCUS_FLIGHT, + new AspectList().add(Aspect.MOTION, 1).add(Aspect.MAGIC, 1).add(Aspect.AIR, 2), + -3, + -4, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_FOCUS_SMELT).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_FLIGHT)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusHeal.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusHeal.java index 8c4378bc..7d08366c 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusHeal.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusHeal.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [26 Oct 2013, 12:04:52 (GMT)] @@ -16,10 +13,12 @@ package thaumic.tinkerer.common.item.foci; import java.util.HashMap; import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -38,8 +37,7 @@ import thaumic.tinkerer.common.research.TTResearchItem; public class ItemFocusHeal extends ItemModFocus { - private static final AspectList visUsage = - new AspectList().add(Aspect.EARTH, 45).add(Aspect.WATER, 45); + private static final AspectList visUsage = new AspectList().add(Aspect.EARTH, 45).add(Aspect.WATER, 45); public static Map playerHealData = new HashMap(); @@ -80,8 +78,8 @@ public class ItemFocusHeal extends ItemModFocus { } @Override - public void onPlayerStoppedUsingFocus( - ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt) { + public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, + int paramInt) { playerHealData.put(paramEntityPlayer.getGameProfile().getName(), 0); } @@ -118,15 +116,15 @@ public class ItemFocusHeal extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; } return null; } @@ -149,16 +147,14 @@ public class ItemFocusHeal extends ItemModFocus { return null; } return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_HEAL, - new AspectList().add(Aspect.HEAL, 2).add(Aspect.SOUL, 1).add(Aspect.MAGIC, 1), - -6, - -4, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_FOCUS_DEFLECT) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_HEAL)) - .setSecondary(); + LibResearch.KEY_FOCUS_HEAL, + new AspectList().add(Aspect.HEAL, 2).add(Aspect.SOUL, 1).add(Aspect.MAGIC, 1), + -6, + -4, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_FOCUS_DEFLECT).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_HEAL)) + .setSecondary(); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusSmelt.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusSmelt.java index fd07ca58..bd802374 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusSmelt.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusSmelt.java @@ -2,12 +2,14 @@ package thaumic.tinkerer.common.item.foci; import java.util.HashMap; import java.util.Map; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.util.MovingObjectPosition; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -26,8 +28,7 @@ import thaumic.tinkerer.common.research.TTResearchItem; public class ItemFocusSmelt extends ItemModFocus { - private static final AspectList visUsage = - new AspectList().add(Aspect.FIRE, 45).add(Aspect.ENTROPY, 12); + private static final AspectList visUsage = new AspectList().add(Aspect.FIRE, 45).add(Aspect.ENTROPY, 12); public static Map playerData = new HashMap(); private int soundCooldown = 3; // In ticks @@ -44,18 +45,13 @@ public class ItemFocusSmelt extends ItemModFocus { @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_SMELT, - new AspectList() - .add(Aspect.FIRE, 2) - .add(Aspect.ENERGY, 1) - .add(Aspect.MAGIC, 1), - -2, - -2, - 2, - new ItemStack(this)) - .setParents("FOCUSEXCAVATION") - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FOCUS_SMELT)); + LibResearch.KEY_FOCUS_SMELT, + new AspectList().add(Aspect.FIRE, 2).add(Aspect.ENERGY, 1).add(Aspect.MAGIC, 1), + -2, + -2, + 2, + new ItemStack(this)).setParents("FOCUSEXCAVATION").setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_FOCUS_SMELT)); } @Override @@ -115,11 +111,11 @@ public class ItemFocusSmelt extends ItemModFocus { playerData.remove(p.getGameProfile().getName()); decremented = false; } - // Sound + // Sound //////////////////// p.worldObj.playSoundAtEntity(p, "fire.ignite", 0.6F, 1F); p.worldObj.playSoundAtEntity(p, "fire.fire", 1F, 1F); - // Particle + // Particle //////////////////// for (int i = 0; i < 25; i++) { double x = pos.blockX + Math.random(); @@ -145,10 +141,10 @@ public class ItemFocusSmelt extends ItemModFocus { int potency = wand.getFocusPotency(stack); // TODO review what this does playerData.put(p.getGameProfile().getName(), new SmeltData(pos, 20 - Math.min(3, potency) * 5)); } else { - // Sound + // Sound //////////////////// if (time % soundCooldown == 0) p.worldObj.playSoundAtEntity(p, "fire.fire", 0.2F, 1F); - // Particle + // Particle //////////////////// for (int i = 0; i < 2; i++) { double x = pos.blockX + Math.random(); @@ -168,19 +164,18 @@ public class ItemFocusSmelt extends ItemModFocus { } } - if (p.worldObj.isRemote) - ThaumicTinkerer.tcProxy.beamCont( - p.worldObj, - p, - pos.blockX + 0.5, - pos.blockY + 0.5, - pos.blockZ + 0.5, - 2, - 0xFF0000, - true, - 0F, - null, - 1); + if (p.worldObj.isRemote) ThaumicTinkerer.tcProxy.beamCont( + p.worldObj, + p, + pos.blockX + 0.5, + pos.blockY + 0.5, + pos.blockZ + 0.5, + 2, + 0xFF0000, + true, + 0F, + null, + 1); } } } @@ -208,20 +203,21 @@ public class ItemFocusSmelt extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal /*, FocusUpgradeType.potency*/}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal /* , FocusUpgradeType.potency */ }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal /*, FocusUpgradeType.potency*/}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal /* , FocusUpgradeType.potency */ }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal /*, FocusUpgradeType.potency*/}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal /* , FocusUpgradeType.potency */ }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal /*, FocusUpgradeType.potency*/}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal /* , FocusUpgradeType.potency */ }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal /*, FocusUpgradeType.potency*/}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal /* , FocusUpgradeType.potency */ }; } return null; } static class SmeltData { + public MovingObjectPosition pos; public int progress; diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusTelekinesis.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusTelekinesis.java index f20c5b46..f8b7c46a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusTelekinesis.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemFocusTelekinesis.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [11 Sep 2013, 23:21:21 (GMT)] @@ -15,11 +12,13 @@ package thaumic.tinkerer.common.item.foci; import java.util.List; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -39,8 +38,7 @@ import thaumic.tinkerer.common.research.TTResearchItem; public class ItemFocusTelekinesis extends ItemModFocus { - private static final AspectList visUsage = - new AspectList().add(Aspect.AIR, 5).add(Aspect.ENTROPY, 5); + private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 5).add(Aspect.ENTROPY, 5); @Override public void onUsingFocusTick(ItemStack stack, EntityPlayer player, int ticks) { @@ -101,15 +99,15 @@ public class ItemFocusTelekinesis extends ItemModFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; } return null; } @@ -122,19 +120,14 @@ public class ItemFocusTelekinesis extends ItemModFocus { @Override public IRegisterableResearch getResearchItem() { return (TTResearchItem) new TTResearchItem( - LibResearch.KEY_FOCUS_TELEKINESIS, - new AspectList() - .add(Aspect.ELDRITCH, 2) - .add(Aspect.MAGIC, 1) - .add(Aspect.MOTION, 1), - -4, - -6, - 2, - new ItemStack(this)) - .setParents(LibResearch.KEY_FOCUS_FLIGHT) - .setConcealed() - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_TELEKINESIS)) - .setSecondary(); + LibResearch.KEY_FOCUS_TELEKINESIS, + new AspectList().add(Aspect.ELDRITCH, 2).add(Aspect.MAGIC, 1).add(Aspect.MOTION, 1), + -4, + -6, + 2, + new ItemStack(this)).setParents(LibResearch.KEY_FOCUS_FLIGHT).setConcealed() + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_TELEKINESIS)) + .setSecondary(); } @Override @@ -143,10 +136,7 @@ public class ItemFocusTelekinesis extends ItemModFocus { LibResearch.KEY_FOCUS_TELEKINESIS, new ItemStack(this), 5, - new AspectList() - .add(Aspect.MOTION, 10) - .add(Aspect.AIR, 20) - .add(Aspect.ENTROPY, 20) + new AspectList().add(Aspect.MOTION, 10).add(Aspect.AIR, 20).add(Aspect.ENTROPY, 20) .add(Aspect.MIND, 10), new ItemStack(Items.ender_pearl), new ItemStack(Items.quartz), diff --git a/src/main/java/thaumic/tinkerer/common/item/foci/ItemModFocus.java b/src/main/java/thaumic/tinkerer/common/item/foci/ItemModFocus.java index 3f0d02b4..140fe0c3 100644 --- a/src/main/java/thaumic/tinkerer/common/item/foci/ItemModFocus.java +++ b/src/main/java/thaumic/tinkerer/common/item/foci/ItemModFocus.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 19:22:59 (GMT)] */ package thaumic.tinkerer.common.item.foci; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -25,6 +21,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; @@ -33,6 +30,8 @@ import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.registry.ITTinkererItem; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererItem { @@ -83,22 +82,15 @@ public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererI public ThaumicTinkererRecipe getRecipeItem() { return null; } + /* - @Override - public boolean isItemTool(ItemStack par1ItemStack) { - return true; - } - */ + * @Override public boolean isItemTool(ItemStack par1ItemStack) { return true; } + */ /* - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { - AspectList cost = getVisCost(stack); - if (cost != null) { - list.add(StatCollector.translateToLocal(isVisCostPerTick(stack) ? "item.Focus.cost2" : "item.Focus.cost1")); - addVisCostTooltip(cost, stack, player, list, par4); - } - } - */ + * @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { AspectList + * cost = getVisCost(stack); if (cost != null) { list.add(StatCollector.translateToLocal(isVisCostPerTick(stack) ? + * "item.Focus.cost2" : "item.Focus.cost1")); addVisCostTooltip(cost, stack, player, list, par4); } } + */ protected void addVisCostTooltip(AspectList cost, ItemStack stack, EntityPlayer player, List list, boolean par4) { for (Aspect aspect : cost.getAspectsSorted()) { float amount = cost.getAmount(aspect) / 100.0F; @@ -136,10 +128,7 @@ public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererI } @Override - public ItemStack onFocusRightClick( - ItemStack paramItemStack, - World paramWorld, - EntityPlayer paramEntityPlayer, + public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) { if (isUseItem(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE); @@ -152,14 +141,14 @@ public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererI } @Override - public void onPlayerStoppedUsingFocus( - ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt) { + public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, + int paramInt) { // NO-OP } @Override - public boolean onFocusBlockStartBreak( - ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, EntityPlayer paramEntityPlayer) { + public boolean onFocusBlockStartBreak(ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, + EntityPlayer paramEntityPlayer) { return false; } diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockTalisman.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockTalisman.java index 43d8f3b1..1a169faa 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockTalisman.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockTalisman.java @@ -1,25 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 30, 2013, 12:46:22 AM (GMT)] */ package thaumic.tinkerer.common.item.kami; -import baubles.api.BaubleType; -import baubles.api.IBauble; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Arrays; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; @@ -35,6 +29,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -54,8 +49,13 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import baubles.api.BaubleType; +import baubles.api.IBauble; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemBlockTalisman extends ItemKamiBase implements IBauble { + @Deprecated private static final String TAG_BLOCK_ID = "blockID"; @@ -118,17 +118,8 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { } @Override - public boolean onItemUse( - ItemStack par1ItemStack, - EntityPlayer par2EntityPlayer, - World par3World, - int par4, - int par5, - int par6, - int par7, - float par8, - float par9, - float par10) { + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, + int par5, int par6, int par7, float par8, float par9, float par10) { Block block = par3World.getBlock(par4, par5, par6); int meta = par3World.getBlockMetadata(par4, par5, par6); boolean set = setBlock(par1ItemStack, block, meta); @@ -140,8 +131,7 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { TileEntity tile = par3World.getTileEntity(par4, par5, par6); if (tile != null && tile instanceof IInventory) { IInventory inv = (IInventory) tile; - int[] slots = inv instanceof ISidedInventory - ? ((ISidedInventory) inv).getAccessibleSlotsFromSide(par7) + int[] slots = inv instanceof ISidedInventory ? ((ISidedInventory) inv).getAccessibleSlotsFromSide(par7) : TileTransvectorInterface.buildSlotsForLinearInventory(inv); for (int slot : slots) { ItemStack stackInSlot = inv.getStackInSlot(slot); @@ -150,9 +140,8 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { int maxSize = stack.getMaxStackSize(); stack.stackSize = remove(par1ItemStack, maxSize); if (stack.stackSize != 0) { - if (inv.isItemValidForSlot(slot, stack) - && (!(inv instanceof ISidedInventory) - || ((ISidedInventory) inv).canInsertItem(slot, stack, par7))) { + if (inv.isItemValidForSlot(slot, stack) && (!(inv instanceof ISidedInventory) + || ((ISidedInventory) inv).canInsertItem(slot, stack, par7))) { inv.setInventorySlotContents(slot, stack); inv.markDirty(); set = true; @@ -160,32 +149,30 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { } } else if (stackInSlot.getItem() == Item.getItemFromBlock(bBlock) && stackInSlot.getItemDamage() == bmeta) { - int maxSize = stackInSlot.getMaxStackSize(); - int missing = maxSize - stackInSlot.stackSize; - if (inv.isItemValidForSlot(slot, stackInSlot) - && (!(inv instanceof ISidedInventory) + int maxSize = stackInSlot.getMaxStackSize(); + int missing = maxSize - stackInSlot.stackSize; + if (inv.isItemValidForSlot(slot, stackInSlot) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stackInSlot, par7))) { - stackInSlot.stackSize += remove(par1ItemStack, missing); - inv.markDirty(); - set = true; - } - } + stackInSlot.stackSize += remove(par1ItemStack, missing); + inv.markDirty(); + set = true; + } + } } } else { int remove = remove(par1ItemStack, 1); if (remove > 0) { - Item.getItemFromBlock(bBlock) - .onItemUse( - new ItemStack(bBlock, 1, bmeta), - par2EntityPlayer, - par3World, - par4, - par5, - par6, - par7, - par8, - par9, - par10); + Item.getItemFromBlock(bBlock).onItemUse( + new ItemStack(bBlock, 1, bmeta), + par2EntityPlayer, + par3World, + par4, + par5, + par6, + par7, + par8, + par9, + par10); set = true; } } @@ -229,9 +216,11 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { Block block = getBlock(par1ItemStack); if (block != null && block != Blocks.air) { int count = getBlockCount(par1ItemStack); - par3List.add(StatCollector.translateToLocal( - new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") - + " (x" + count + ")"); + par3List.add( + StatCollector.translateToLocal( + new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") + " (x" + + count + + ")"); } if (par1ItemStack.getItemDamage() == 1) par3List.add(StatCollector.translateToLocal("ttmisc.active")); @@ -251,8 +240,7 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { @Override public void onWornTick(ItemStack itemstack, EntityLivingBase entity) { Block block = getBlock(itemstack); - if (!entity.worldObj.isRemote - && itemstack.getItemDamage() == 1 + if (!entity.worldObj.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.air && entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) entity; @@ -279,10 +267,8 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { if (highest == -1) { ItemStack heldItem = player.inventory.getItemStack(); - if (hasFreeSlot - && (heldItem == null - || Item.getItemFromBlock(block) == heldItem.getItem() - || heldItem.getItemDamage() != meta)) { + if (hasFreeSlot && (heldItem == null || Item.getItemFromBlock(block) == heldItem.getItem() + || heldItem.getItemDamage() != meta)) { ItemStack stack = new ItemStack(block, remove(itemstack, 64), meta); if (stack.stackSize != 0) player.inventory.addItemStackToInventory(stack); } @@ -332,18 +318,14 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_BLOCK_TALISMAN, - new AspectList() - .add(Aspect.VOID, 2) - .add(Aspect.DARKNESS, 1) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.MAGIC, 1), - 14, - 17, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_PICK_GEM, LibResearch.KEY_ICHOR_SHOVEL_GEM) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_BLOCK_TALISMAN)); + LibResearch.KEY_BLOCK_TALISMAN, + new AspectList().add(Aspect.VOID, 2).add(Aspect.DARKNESS, 1).add(Aspect.ELDRITCH, 1) + .add(Aspect.MAGIC, 1), + 14, + 17, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_PICK_GEM, LibResearch.KEY_ICHOR_SHOVEL_GEM) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_BLOCK_TALISMAN)); } @Override @@ -352,10 +334,7 @@ public class ItemBlockTalisman extends ItemKamiBase implements IBauble { LibResearch.KEY_BLOCK_TALISMAN, new ItemStack(this), 9, - new AspectList() - .add(Aspect.VOID, 65) - .add(Aspect.DARKNESS, 32) - .add(Aspect.MAGIC, 50) + new AspectList().add(Aspect.VOID, 65).add(Aspect.DARKNESS, 32).add(Aspect.MAGIC, 50) .add(Aspect.ELDRITCH, 32), new ItemStack(ConfigItems.itemFocusPortableHole), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockWarpGate.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockWarpGate.java index b021f0cd..c242f9a6 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockWarpGate.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemBlockWarpGate.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 4:39:07 PM (GMT)] @@ -15,10 +12,12 @@ package thaumic.tinkerer.common.item.kami; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.core.proxy.TTCommonProxy; import thaumic.tinkerer.common.lib.LibBlockNames; import thaumic.tinkerer.common.registry.ITTinkererItem; diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemCatAmulet.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemCatAmulet.java index 4581544a..b869ee89 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemCatAmulet.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemCatAmulet.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 7:41:50 PM (GMT)] */ package thaumic.tinkerer.common.item.kami; -import baubles.api.BaubleType; -import baubles.api.IBauble; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; @@ -34,6 +30,7 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -48,6 +45,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import baubles.api.BaubleType; +import baubles.api.IBauble; public class ItemCatAmulet extends ItemKamiBase implements IBauble { @@ -73,8 +72,10 @@ public class ItemCatAmulet extends ItemKamiBase implements IBauble { } private void messWithGetTargetAI(EntityAINearestAttackableTarget aiEntry) { - if (aiEntry.targetClass == EntityPlayer.class) - aiEntry.targetClass = EntityEnderCrystal.class; // Something random that won't be around + if (aiEntry.targetClass == EntityPlayer.class) aiEntry.targetClass = EntityEnderCrystal.class; // Something + // random that + // won't be + // around } @Override @@ -141,18 +142,13 @@ public class ItemCatAmulet extends ItemKamiBase implements IBauble { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_CAT_AMULET, - new AspectList() - .add(Aspect.MIND, 2) - .add(Aspect.ORDER, 1) - .add(Aspect.DARKNESS, 1) - .add(Aspect.DEATH, 1), - 13, - 10, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORIUM) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_CAT_AMULET)); + LibResearch.KEY_CAT_AMULET, + new AspectList().add(Aspect.MIND, 2).add(Aspect.ORDER, 1).add(Aspect.DARKNESS, 1).add(Aspect.DEATH, 1), + 13, + 10, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORIUM) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_CAT_AMULET)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemIchorPouch.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemIchorPouch.java index 245f9c3b..d561da04 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemIchorPouch.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemIchorPouch.java @@ -1,24 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 10:15:39 PM (GMT)] */ package thaumic.tinkerer.common.item.kami; -import baubles.api.BaubleType; -import baubles.api.IBauble; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -30,6 +24,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.Constants; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -50,6 +45,10 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import baubles.api.BaubleType; +import baubles.api.IBauble; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIchorPouch extends ItemFocusPouch implements IBauble, ITTinkererItem { @@ -143,18 +142,13 @@ public class ItemIchorPouch extends ItemFocusPouch implements IBauble, ITTinkere public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHOR_POUCH, - new AspectList() - .add(Aspect.VOID, 2) - .add(Aspect.CLOTH, 1) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.MAN, 1), - 13, - 6, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_CLOTH) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_POUCH)); + LibResearch.KEY_ICHOR_POUCH, + new AspectList().add(Aspect.VOID, 2).add(Aspect.CLOTH, 1).add(Aspect.ELDRITCH, 1).add(Aspect.MAN, 1), + 13, + 6, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_CLOTH) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_POUCH)); } @Override @@ -163,11 +157,7 @@ public class ItemIchorPouch extends ItemFocusPouch implements IBauble, ITTinkere LibResearch.KEY_ICHOR_POUCH, new ItemStack(this), 9, - new AspectList() - .add(Aspect.VOID, 64) - .add(Aspect.MAN, 32) - .add(Aspect.CLOTH, 32) - .add(Aspect.ELDRITCH, 32) + new AspectList().add(Aspect.VOID, 64).add(Aspect.MAN, 32).add(Aspect.CLOTH, 32).add(Aspect.ELDRITCH, 32) .add(Aspect.AIR, 64), new ItemStack(ConfigItems.itemFocusPouch), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 1), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemKamiResource.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemKamiResource.java index b0d10768..10aa0d50 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemKamiResource.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemKamiResource.java @@ -1,21 +1,18 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 21, 2013, 7:34:11 PM (GMT)] */ package thaumic.tinkerer.common.item.kami; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; @@ -23,6 +20,7 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -35,6 +33,7 @@ import thaumic.tinkerer.common.lib.LibItemNames; import thaumic.tinkerer.common.lib.LibResearch; import thaumic.tinkerer.common.registry.*; import thaumic.tinkerer.common.research.*; +import cpw.mods.fml.common.registry.GameRegistry; public class ItemKamiResource extends ItemKamiBase { @@ -66,15 +65,13 @@ public class ItemKamiResource extends ItemKamiBase { @Override public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { - return par1ItemStack.getItemDamage() >= subtypes - ? super.getUnlocalizedName(par1ItemStack) + return par1ItemStack.getItemDamage() >= subtypes ? super.getUnlocalizedName(par1ItemStack) : "item." + LibItemNames.KAMI_RESOURCE_NAMES[par1ItemStack.getItemDamage()]; } @Override public EnumRarity getRarity(ItemStack par1ItemStack) { - return par1ItemStack.getItemDamage() != 7 && par1ItemStack.getItemDamage() != 6 - ? TTCommonProxy.kamiRarity + return par1ItemStack.getItemDamage() != 7 && par1ItemStack.getItemDamage() != 6 ? TTCommonProxy.kamiRarity : super.getRarity(par1ItemStack); } @@ -90,100 +87,67 @@ public class ItemKamiResource extends ItemKamiBase { TTResearchItemMulti researchItemMulti = new TTResearchItemMulti(); research = (TTResearchItem) new KamiResearchItem( - LibResearch.KEY_DIMENSION_SHARDS, - new AspectList(), - 7, - 8, - 0, - new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7)) - .setStub() - .setAutoUnlock() - .setRound(); + LibResearch.KEY_DIMENSION_SHARDS, + new AspectList(), + 7, + 8, + 0, + new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7)).setStub() + .setAutoUnlock().setRound(); research.setPages(new ResearchPage("0")); researchItemMulti.addResearch(research); research = new KamiResearchItem( - LibResearch.KEY_ICHOR, - new AspectList() - .add(Aspect.MAN, 1) - .add(Aspect.LIGHT, 2) - .add(Aspect.SOUL, 1) - .add(Aspect.TAINT, 1), - 9, - 8, - 5, - new ItemStack(this, 1, 0)) - .setWarp(5); + LibResearch.KEY_ICHOR, + new AspectList().add(Aspect.MAN, 1).add(Aspect.LIGHT, 2).add(Aspect.SOUL, 1).add(Aspect.TAINT, 1), + 9, + 8, + 5, + new ItemStack(this, 1, 0)).setWarp(5); research.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR)); ResearchHelper.kamiResearch = research; researchItemMulti.addResearch(research); research = (TTResearchItem) new KamiResearchItem( - LibResearch.KEY_ICHOR_CLOTH, - new AspectList() - .add(Aspect.CLOTH, 2) - .add(Aspect.LIGHT, 1) - .add(Aspect.CRAFT, 1) - .add(Aspect.SENSES, 1), - 11, - 7, - 5, - new ItemStack(this, 1, 1)) - .setConcealed() - .setParents(LibResearch.KEY_ICHOR); + LibResearch.KEY_ICHOR_CLOTH, + new AspectList().add(Aspect.CLOTH, 2).add(Aspect.LIGHT, 1).add(Aspect.CRAFT, 1).add(Aspect.SENSES, 1), + 11, + 7, + 5, + new ItemStack(this, 1, 1)).setConcealed().setParents(LibResearch.KEY_ICHOR); research.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_CLOTH)); researchItemMulti.addResearch(research); research = (TTResearchItem) new KamiResearchItem( - LibResearch.KEY_ICHORIUM, - new AspectList() - .add(Aspect.METAL, 2) - .add(Aspect.LIGHT, 1) - .add(Aspect.CRAFT, 1) - .add(Aspect.TOOL, 1), - 11, - 9, - 5, - new ItemStack(this, 1, 2)) - .setConcealed() - .setParents(LibResearch.KEY_ICHOR) - .setParentsHidden(LibResearch.KEY_ICHOR_CLOTH); + LibResearch.KEY_ICHORIUM, + new AspectList().add(Aspect.METAL, 2).add(Aspect.LIGHT, 1).add(Aspect.CRAFT, 1).add(Aspect.TOOL, 1), + 11, + 9, + 5, + new ItemStack(this, 1, 2)).setConcealed().setParents(LibResearch.KEY_ICHOR) + .setParentsHidden(LibResearch.KEY_ICHOR_CLOTH); research.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHORIUM)); researchItemMulti.addResearch(research); research = (TTResearchItem) new KamiResearchItem( - LibResearch.KEY_ICHOR_CAP, - new AspectList() - .add(Aspect.TOOL, 2) - .add(Aspect.METAL, 1) - .add(Aspect.LIGHT, 1) - .add(Aspect.MAGIC, 1), - 11, - 11, - 5, - new ItemStack(this, 1, 4)) - .setWarp(2) - .setConcealed() - .setParents(LibResearch.KEY_ICHORIUM); + LibResearch.KEY_ICHOR_CAP, + new AspectList().add(Aspect.TOOL, 2).add(Aspect.METAL, 1).add(Aspect.LIGHT, 1).add(Aspect.MAGIC, 1), + 11, + 11, + 5, + new ItemStack(this, 1, 4)).setWarp(2).setConcealed().setParents(LibResearch.KEY_ICHORIUM); research.setPages(new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_CAP)); researchItemMulti.addResearch(research); research = (TTResearchItem) new KamiResearchItem( - LibResearch.KEY_ICHORCLOTH_ROD, - new AspectList() - .add(Aspect.TOOL, 2) - .add(Aspect.CLOTH, 1) - .add(Aspect.LIGHT, 1) - .add(Aspect.MAGIC, 1), - 14, - 2, - 5, - new ItemStack(this, 1, 5)) - .setWarp(1) - .setConcealed() - .setParents(LibResearch.KEY_ICHOR_CLOTH) - .setParentsHidden(LibResearch.KEY_ICHOR_CAP); + LibResearch.KEY_ICHORCLOTH_ROD, + new AspectList().add(Aspect.TOOL, 2).add(Aspect.CLOTH, 1).add(Aspect.LIGHT, 1).add(Aspect.MAGIC, 1), + 14, + 2, + 5, + new ItemStack(this, 1, 5)).setWarp(1).setConcealed().setParents(LibResearch.KEY_ICHOR_CLOTH) + .setParentsHidden(LibResearch.KEY_ICHOR_CAP); research.setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_ROD)); researchItemMulti.addResearch(research); @@ -198,13 +162,8 @@ public class ItemKamiResource extends ItemKamiBase { LibResearch.KEY_ICHOR_CLOTH, LibResearch.KEY_ICHOR_CLOTH, new ItemStack(this, 3, 1), - new AspectList() - .add(Aspect.FIRE, 125) - .add(Aspect.EARTH, 125) - .add(Aspect.WATER, 125) - .add(Aspect.AIR, 125) - .add(Aspect.ORDER, 125) - .add(Aspect.ENTROPY, 125), + new AspectList().add(Aspect.FIRE, 125).add(Aspect.EARTH, 125).add(Aspect.WATER, 125) + .add(Aspect.AIR, 125).add(Aspect.ORDER, 125).add(Aspect.ENTROPY, 125), "CCC", "III", "DDD", @@ -218,13 +177,8 @@ public class ItemKamiResource extends ItemKamiBase { LibResearch.KEY_ICHORIUM, LibResearch.KEY_ICHORIUM, new ItemStack(this, 1, 2), - new AspectList() - .add(Aspect.FIRE, 100) - .add(Aspect.EARTH, 100) - .add(Aspect.WATER, 100) - .add(Aspect.AIR, 100) - .add(Aspect.ORDER, 100) - .add(Aspect.ENTROPY, 100), + new AspectList().add(Aspect.FIRE, 100).add(Aspect.EARTH, 100).add(Aspect.WATER, 100) + .add(Aspect.AIR, 100).add(Aspect.ORDER, 100).add(Aspect.ENTROPY, 100), " T ", "IDI", " I ", @@ -238,13 +192,8 @@ public class ItemKamiResource extends ItemKamiBase { LibResearch.KEY_ICHOR_CAP, LibResearch.KEY_ICHOR_CAP, new ItemStack(this, 2, 4), - new AspectList() - .add(Aspect.FIRE, 100) - .add(Aspect.EARTH, 100) - .add(Aspect.WATER, 100) - .add(Aspect.AIR, 100) - .add(Aspect.ORDER, 100) - .add(Aspect.ENTROPY, 100), + new AspectList().add(Aspect.FIRE, 100).add(Aspect.EARTH, 100).add(Aspect.WATER, 100) + .add(Aspect.AIR, 100).add(Aspect.ORDER, 100).add(Aspect.ENTROPY, 100), "ICI", " M ", "ICI", @@ -258,10 +207,7 @@ public class ItemKamiResource extends ItemKamiBase { LibResearch.KEY_ICHOR, new ItemStack(this, 8, 0), 7, - new AspectList() - .add(Aspect.MAN, 32) - .add(Aspect.LIGHT, 32) - .add(Aspect.SOUL, 64), + new AspectList().add(Aspect.MAN, 32).add(Aspect.LIGHT, 32).add(Aspect.SOUL, 64), new ItemStack(Items.nether_star), new ItemStack(Items.diamond), new ItemStack(this, 8, 7), @@ -271,10 +217,7 @@ public class ItemKamiResource extends ItemKamiBase { LibResearch.KEY_ICHORCLOTH_ROD, new ItemStack(this, 1, 5), 9, - new AspectList() - .add(Aspect.MAGIC, 100) - .add(Aspect.LIGHT, 32) - .add(Aspect.TOOL, 32), + new AspectList().add(Aspect.MAGIC, 100).add(Aspect.LIGHT, 32).add(Aspect.TOOL, 32), new ItemStack(ConfigItems.itemWandRod, 1, 2), new ItemStack(this), new ItemStack(this, 1, 1), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemPlacementMirror.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemPlacementMirror.java index 2ff7a3c8..d3c34228 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemPlacementMirror.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemPlacementMirror.java @@ -1,9 +1,8 @@ package thaumic.tinkerer.common.item.kami; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -15,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -33,6 +33,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemPlacementMirror extends ItemKamiBase { @@ -59,8 +61,7 @@ public class ItemPlacementMirror extends ItemKamiBase { List talismansToCheck = new ArrayList(); for (int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stackInSlot = player.inventory.getStackInSlot(i); - if (stackInSlot != null - && stackInSlot.getItem() == reqStack.getItem() + if (stackInSlot != null && stackInSlot.getItem() == reqStack.getItem() && stackInSlot.getItemDamage() == reqStack.getItemDamage()) { current += stackInSlot.stackSize; if (current >= required) return true; @@ -105,20 +106,18 @@ public class ItemPlacementMirror extends ItemKamiBase { ? topOrBottom ? player.rotationPitch > 75 || (rotation & 1) == 1 ? range : 0 : range : 0; - for (int x = -xOff; x < xOff + 1; x++) - for (int y = 0; y < yOff * 2 + 1; y++) { - for (int z = -zOff; z < zOff + 1; z++) { - int xp = pos.blockX + x + dir.offsetX; - int yp = pos.blockY + y + dir.offsetY; - int zp = pos.blockZ + z + dir.offsetZ; + for (int x = -xOff; x < xOff + 1; x++) for (int y = 0; y < yOff * 2 + 1; y++) { + for (int z = -zOff; z < zOff + 1; z++) { + int xp = pos.blockX + x + dir.offsetX; + int yp = pos.blockY + y + dir.offsetY; + int zp = pos.blockZ + z + dir.offsetZ; - Block block1 = player.worldObj.getBlock(xp, yp, zp); - if (block1 == null - || block1.isAir(player.worldObj, xp, yp, zp) - || block1.isReplaceable(player.worldObj, xp, yp, zp)) - coords.add(new ChunkCoordinates(xp, yp, zp)); - } + Block block1 = player.worldObj.getBlock(xp, yp, zp); + if (block1 == null || block1.isAir(player.worldObj, xp, yp, zp) + || block1.isReplaceable(player.worldObj, xp, yp, zp)) + coords.add(new ChunkCoordinates(xp, yp, zp)); } + } } return coords.toArray(new ChunkCoordinates[coords.size()]); @@ -153,17 +152,8 @@ public class ItemPlacementMirror extends ItemKamiBase { } @Override - public boolean onItemUse( - ItemStack par1ItemStack, - EntityPlayer par2EntityPlayer, - World par3World, - int par4, - int par5, - int par6, - int par7, - float par8, - float par9, - float par10) { + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, + int par5, int par6, int par7, float par8, float par9, float par10) { Block block = par3World.getBlock(par4, par5, par6); int meta = par3World.getBlockMetadata(par4, par5, par6); @@ -211,8 +201,7 @@ public class ItemPlacementMirror extends ItemKamiBase { List talismansToCheck = new ArrayList(); for (int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stackInSlot = player.inventory.getStackInSlot(i); - if (stackInSlot != null - && stackInSlot.getItem() == blockToPlace.getItem() + if (stackInSlot != null && stackInSlot.getItem() == blockToPlace.getItem() && stackInSlot.getItemDamage() == blockToPlace.getItemDamage()) { stackInSlot.stackSize--; if (stackInSlot.stackSize == 0) player.inventory.setInventorySlotContents(i, null); @@ -269,9 +258,9 @@ public class ItemPlacementMirror extends ItemKamiBase { int size = getSize(par1ItemStack); par3List.add(size + " x " + size); - if (block != null && block != Blocks.air) - par3List.add(StatCollector.translateToLocal( - new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name")); + if (block != null && block != Blocks.air) par3List.add( + StatCollector.translateToLocal( + new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name")); } @Override @@ -283,18 +272,14 @@ public class ItemPlacementMirror extends ItemKamiBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_PLACEMENT_MIRROR, - new AspectList() - .add(Aspect.CRAFT, 2) - .add(Aspect.CRYSTAL, 1) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.MIND, 1), - 17, - 16, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_BLOCK_TALISMAN) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_PLACEMENT_MIRROR)); + LibResearch.KEY_PLACEMENT_MIRROR, + new AspectList().add(Aspect.CRAFT, 2).add(Aspect.CRYSTAL, 1).add(Aspect.ELDRITCH, 1) + .add(Aspect.MIND, 1), + 17, + 16, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_BLOCK_TALISMAN) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_PLACEMENT_MIRROR)); } @Override @@ -303,10 +288,7 @@ public class ItemPlacementMirror extends ItemKamiBase { LibResearch.KEY_PLACEMENT_MIRROR, new ItemStack(this), 12, - new AspectList() - .add(Aspect.CRAFT, 65) - .add(Aspect.CRYSTAL, 32) - .add(Aspect.MAGIC, 50) + new AspectList().add(Aspect.CRAFT, 65).add(Aspect.CRYSTAL, 32).add(Aspect.MAGIC, 50) .add(Aspect.MIND, 32), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBlockTalisman.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemProtoclay.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemProtoclay.java index 5cc9d2b2..0db770ec 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemProtoclay.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemProtoclay.java @@ -1,20 +1,16 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 9, 2014, 10:01:41 PM (GMT)] */ package thaumic.tinkerer.common.item.kami; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -27,6 +23,7 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -43,6 +40,7 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ItemProtoclay extends ItemKamiBase { @@ -81,8 +79,7 @@ public class ItemProtoclay extends ItemKamiBase { for (int i = 0; i < player.inventory.getSizeInventory(); i++) { ItemStack stackInSlot = player.inventory.getStackInSlot(i); - if (stackInSlot != null - && stackInSlot.getItem() instanceof IAdvancedTool + if (stackInSlot != null && stackInSlot.getItem() instanceof IAdvancedTool && stackInSlot != currentStack) { IAdvancedTool toolInSlot = (IAdvancedTool) stackInSlot.getItem(); if (toolInSlot.getType().equals(typeToFind)) { @@ -98,50 +95,50 @@ public class ItemProtoclay extends ItemKamiBase { @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { - // if (!(par3Entity instanceof EntityPlayer)) - // return; + // if (!(par3Entity instanceof EntityPlayer)) + // return; // - // EntityPlayer player = (EntityPlayer) par3Entity; - // ItemStack currentStack = player.getCurrentEquippedItem(); - // if (currentStack == null || !(currentStack.getItem() instanceof IAdvancedTool)) - // return; - // IAdvancedTool tool = (IAdvancedTool) currentStack.getItem(); + // EntityPlayer player = (EntityPlayer) par3Entity; + // ItemStack currentStack = player.getCurrentEquippedItem(); + // if (currentStack == null || !(currentStack.getItem() instanceof IAdvancedTool)) + // return; + // IAdvancedTool tool = (IAdvancedTool) currentStack.getItem(); // - // if (tool.getType().equals("sword")) - // return; + // if (tool.getType().equals("sword")) + // return; // - // MovingObjectPosition pos = ToolHandler.raytraceFromEntity(par2World, par3Entity, true, 4.5F); - // String typeToFind = ""; + // MovingObjectPosition pos = ToolHandler.raytraceFromEntity(par2World, par3Entity, true, 4.5F); + // String typeToFind = ""; // - // if (player.isSwingInProgress && pos != null) { - // Block block = par2World.getBlock(pos.blockX, pos.blockY, pos.blockZ); + // if (player.isSwingInProgress && pos != null) { + // Block block = par2World.getBlock(pos.blockX, pos.blockY, pos.blockZ); // - // if (block != null) { - // Material mat = block.getMaterial(); - // if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick)) - // typeToFind = "pick"; - // else if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel)) - // typeToFind = "shovel"; - // else if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe)) - // typeToFind = "axe"; - // } - // } + // if (block != null) { + // Material mat = block.getMaterial(); + // if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick)) + // typeToFind = "pick"; + // else if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel)) + // typeToFind = "shovel"; + // else if (ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe)) + // typeToFind = "axe"; + // } + // } // - // if (tool.getType().equals(typeToFind) || typeToFind.isEmpty()) - // return; + // if (tool.getType().equals(typeToFind) || typeToFind.isEmpty()) + // return; // - // for (int i = 0; i < player.inventory.getSizeInventory(); i++) { - // ItemStack stackInSlot = player.inventory.getStackInSlot(i); - // if (stackInSlot != null && stackInSlot.getItem() instanceof IAdvancedTool && stackInSlot != + // for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + // ItemStack stackInSlot = player.inventory.getStackInSlot(i); + // if (stackInSlot != null && stackInSlot.getItem() instanceof IAdvancedTool && stackInSlot != // currentStack) { - // IAdvancedTool toolInSlot = (IAdvancedTool) stackInSlot.getItem(); - // if (toolInSlot.getType().equals(typeToFind)) { - // player.inventory.setInventorySlotContents(player.inventory.currentItem, stackInSlot); - // player.inventory.setInventorySlotContents(i, currentStack); - // break; - // } - // } - // } + // IAdvancedTool toolInSlot = (IAdvancedTool) stackInSlot.getItem(); + // if (toolInSlot.getType().equals(typeToFind)) { + // player.inventory.setInventorySlotContents(player.inventory.currentItem, stackInSlot); + // player.inventory.setInventorySlotContents(i, currentStack); + // break; + // } + // } + // } } @Override @@ -158,19 +155,14 @@ public class ItemProtoclay extends ItemKamiBase { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_PROTOCLAY, - new AspectList() - .add(Aspect.TOOL, 2) - .add(Aspect.MINE, 1) - .add(Aspect.MAN, 1) - .add(Aspect.MECHANISM, 1), - 12, - 17, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_PICK_GEM) - .setParentsHidden(LibResearch.KEY_ICHOR_SHOVEL_GEM) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_PROTOCLAY)); + LibResearch.KEY_PROTOCLAY, + new AspectList().add(Aspect.TOOL, 2).add(Aspect.MINE, 1).add(Aspect.MAN, 1).add(Aspect.MECHANISM, 1), + 12, + 17, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_PICK_GEM) + .setParentsHidden(LibResearch.KEY_ICHOR_SHOVEL_GEM) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_PROTOCLAY)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/ItemSkyPearl.java b/src/main/java/thaumic/tinkerer/common/item/kami/ItemSkyPearl.java index f92f96d6..a42cc34a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/ItemSkyPearl.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/ItemSkyPearl.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 5:26:45 PM (GMT)] @@ -17,6 +14,7 @@ package thaumic.tinkerer.common.item.kami; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -26,6 +24,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.codechicken.lib.vec.Vector3; @@ -64,13 +63,18 @@ public class ItemSkyPearl extends ItemKamiBase { if (getDim(stack) != dim) { if (!simpleMode) list.add(EnumChatFormatting.RED + StatCollector.translateToLocal("ttmisc.differentDim")); - } else - list.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal("ttmisc.distance") + ": " - + new BigDecimal(MiscHelper.pointDistanceSpace( - x, simpleMode ? 0 : y, z, pos.x, simpleMode ? 0 : pos.y, pos.z)) - .setScale(2, RoundingMode.UP) - .toString() - + "m"); + } else list.add( + EnumChatFormatting.BLUE + StatCollector.translateToLocal("ttmisc.distance") + + ": " + + new BigDecimal( + MiscHelper.pointDistanceSpace( + x, + simpleMode ? 0 : y, + z, + pos.x, + simpleMode ? 0 : pos.y, + pos.z)).setScale(2, RoundingMode.UP).toString() + + "m"); } } @@ -110,17 +114,8 @@ public class ItemSkyPearl extends ItemKamiBase { } @Override - public boolean onItemUse( - ItemStack par1ItemStack, - EntityPlayer par2EntityPlayer, - World par3World, - int par4, - int par5, - int par6, - int par7, - float par8, - float par9, - float par10) { + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, + int par5, int par6, int par7, float par8, float par9, float par10) { Block block = par3World.getBlock(par4, par5, par6); if (block == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockWarpGate.class) && !isAttuned(par1ItemStack)) { @@ -173,10 +168,7 @@ public class ItemSkyPearl extends ItemKamiBase { LibResearch.KEY_WARP_GATE, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class), 2), 6, - new AspectList() - .add(Aspect.TRAVEL, 32) - .add(Aspect.ELDRITCH, 32) - .add(Aspect.FLIGHT, 32) + new AspectList().add(Aspect.TRAVEL, 32).add(Aspect.ELDRITCH, 32).add(Aspect.FLIGHT, 32) .add(Aspect.AIR, 16), new ItemStack(Items.ender_pearl), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemBoots.java b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemBoots.java index 2ea45146..5e96f65c 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemBoots.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemBoots.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 4:12:03 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.armor; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -27,6 +23,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingFallEvent; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -42,6 +39,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ItemGemBoots extends ItemIchorclothArmorAdv { @@ -84,18 +83,14 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHORCLOTH_BOOTS_GEM, - new AspectList() - .add(Aspect.EARTH, 2) - .add(Aspect.TRAVEL, 1) - .add(Aspect.MINE, 1) - .add(Aspect.PLANT, 1), - 15, - 10, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_ARMOR) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_BOOTS_GEM)); + LibResearch.KEY_ICHORCLOTH_BOOTS_GEM, + new AspectList().add(Aspect.EARTH, 2).add(Aspect.TRAVEL, 1).add(Aspect.MINE, 1).add(Aspect.PLANT, 1), + 15, + 10, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ARMOR).setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_BOOTS_GEM)); } @Override @@ -104,16 +99,11 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv { LibResearch.KEY_ICHORCLOTH_BOOTS_GEM, new ItemStack(this), 13, - new AspectList() - .add(Aspect.EARTH, 50) - .add(Aspect.ARMOR, 32) - .add(Aspect.MINE, 32) - .add(Aspect.MOTION, 32) - .add(Aspect.LIGHT, 64) - .add(Aspect.PLANT, 16) - .add(Aspect.TRAVEL, 16), - new ItemStack(ThaumicTinkerer.registry.getItemFromClassAndName( - ItemIchorclothArmor.class, LibItemNames.ICHOR_BOOTS)), + new AspectList().add(Aspect.EARTH, 50).add(Aspect.ARMOR, 32).add(Aspect.MINE, 32).add(Aspect.MOTION, 32) + .add(Aspect.LIGHT, 64).add(Aspect.PLANT, 16).add(Aspect.TRAVEL, 16), + new ItemStack( + ThaumicTinkerer.registry + .getItemFromClassAndName(ItemIchorclothArmor.class, LibItemNames.ICHOR_BOOTS)), new ItemStack(Items.diamond, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), @@ -132,12 +122,10 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv { public void onPlayerJump(LivingJumpEvent event) { if (event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; - boolean hasArmor = player.getCurrentArmor(0) != null - && player.getCurrentArmor(0).getItem() == this; + boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this; - if (hasArmor - && ThaumicTinkerer.proxy.armorStatus(player) - && player.getCurrentArmor(0).getItemDamage() == 0) player.motionY += 0.3; + if (hasArmor && ThaumicTinkerer.proxy.armorStatus(player) && player.getCurrentArmor(0).getItemDamage() == 0) + player.motionY += 0.3; } } @@ -148,8 +136,7 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv { if (event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; - boolean hasArmor = player.getCurrentArmor(0) != null - && player.getCurrentArmor(0).getItem() == this; + boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this; if (hasArmor) { event.distance = 0; } @@ -161,21 +148,15 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv { if (event.entityLiving instanceof EntityPlayer && event.entityLiving.worldObj.isRemote) { EntityPlayer player = (EntityPlayer) event.entityLiving; - boolean highStepListed = - playersWith1Step.contains(player.getGameProfile().getName()); - boolean hasHighStep = player.getCurrentArmor(0) != null - && player.getCurrentArmor(0).getItem() == this; + boolean highStepListed = playersWith1Step.contains(player.getGameProfile().getName()); + boolean hasHighStep = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this; - if (!highStepListed - && (hasHighStep - && ThaumicTinkerer.proxy.armorStatus(player) - && player.getCurrentArmor(0).getItemDamage() == 0)) + if (!highStepListed && (hasHighStep && ThaumicTinkerer.proxy.armorStatus(player) + && player.getCurrentArmor(0).getItemDamage() == 0)) playersWith1Step.add(player.getGameProfile().getName()); - if ((!hasHighStep - || !ThaumicTinkerer.proxy.armorStatus(player) - || player.getCurrentArmor(0).getItemDamage() == 1) - && highStepListed) { + if ((!hasHighStep || !ThaumicTinkerer.proxy.armorStatus(player) + || player.getCurrentArmor(0).getItemDamage() == 1) && highStepListed) { playersWith1Step.remove(player.getGameProfile().getName()); player.stepHeight = 0.5F; } diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemChest.java b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemChest.java index 5a4f2278..58237a23 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemChest.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemChest.java @@ -1,30 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 26, 2013, 4:18:27 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.armor; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -42,6 +38,9 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemGemChest extends ItemIchorclothArmorAdv { @@ -57,8 +56,7 @@ public class ItemGemChest extends ItemIchorclothArmorAdv { private static boolean shouldPlayerHaveFlight(EntityPlayer player) { ItemStack armor = player.getCurrentArmor(2); - return armor != null - && armor.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemChest.class) + return armor != null && armor.getItem() == ThaumicTinkerer.registry.getFirstItemFromClass(ItemGemChest.class) && ThaumicTinkerer.proxy.armorStatus(player) && armor.getItemDamage() == 0 && ConfigHandler.enableFlight; @@ -92,18 +90,14 @@ public class ItemGemChest extends ItemIchorclothArmorAdv { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHORCLOTH_CHEST_GEM, - new AspectList() - .add(Aspect.AIR, 2) - .add(Aspect.MOTION, 1) - .add(Aspect.FLIGHT, 1) - .add(Aspect.ELDRITCH, 1), - 17, - 7, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_ARMOR) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_CHEST_GEM)); + LibResearch.KEY_ICHORCLOTH_CHEST_GEM, + new AspectList().add(Aspect.AIR, 2).add(Aspect.MOTION, 1).add(Aspect.FLIGHT, 1).add(Aspect.ELDRITCH, 1), + 17, + 7, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ARMOR).setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_CHEST_GEM)); } @Override @@ -112,16 +106,11 @@ public class ItemGemChest extends ItemIchorclothArmorAdv { LibResearch.KEY_ICHORCLOTH_CHEST_GEM, new ItemStack(this), 13, - new AspectList() - .add(Aspect.AIR, 50) - .add(Aspect.ARMOR, 32) - .add(Aspect.FLIGHT, 32) - .add(Aspect.ORDER, 32) - .add(Aspect.LIGHT, 64) - .add(Aspect.ELDRITCH, 16) - .add(Aspect.SENSES, 16), - new ItemStack(ThaumicTinkerer.registry.getItemFromClassAndName( - ItemIchorclothArmor.class, LibItemNames.ICHOR_CHEST)), + new AspectList().add(Aspect.AIR, 50).add(Aspect.ARMOR, 32).add(Aspect.FLIGHT, 32).add(Aspect.ORDER, 32) + .add(Aspect.LIGHT, 64).add(Aspect.ELDRITCH, 16).add(Aspect.SENSES, 16), + new ItemStack( + ThaumicTinkerer.registry + .getItemFromClassAndName(ItemIchorclothArmor.class, LibItemNames.ICHOR_CHEST)), new ItemStack(Items.diamond, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemHelm.java b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemHelm.java index 0a2d389d..42223add 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemHelm.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemHelm.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 26, 2013, 12:14:11 AM (GMT)] @@ -21,6 +18,7 @@ import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; + import thaumcraft.api.IGoggles; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -62,8 +60,7 @@ public class ItemGemHelm extends ItemIchorclothArmorAdv implements IGoggles, IRe @Override void tickPlayer(EntityPlayer player) { ItemStack armor = player.getCurrentArmor(3); - if (player.isInsideOfMaterial(Material.water) - && ThaumicTinkerer.proxy.armorStatus(player) + if (player.isInsideOfMaterial(Material.water) && ThaumicTinkerer.proxy.armorStatus(player) && armor.getItemDamage() == 0) { player.setAir(300); PotionEffect effect = player.getActivePotionEffect(Potion.nightVision); @@ -71,8 +68,7 @@ public class ItemGemHelm extends ItemIchorclothArmorAdv implements IGoggles, IRe if (effect != null && effect.duration <= 202) effect.duration = 202; else player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 202, 0, true)); } - if (player.isInsideOfMaterial(Material.lava) - && ThaumicTinkerer.proxy.armorStatus(player) + if (player.isInsideOfMaterial(Material.lava) && ThaumicTinkerer.proxy.armorStatus(player) && armor.getItemDamage() == 0) { player.setAir(300); PotionEffect effect = player.getActivePotionEffect(Potion.blindness); @@ -93,18 +89,14 @@ public class ItemGemHelm extends ItemIchorclothArmorAdv implements IGoggles, IRe public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHORCLOTH_HELM_GEM, - new AspectList() - .add(Aspect.WATER, 2) - .add(Aspect.HEAL, 1) - .add(Aspect.HUNGER, 1) - .add(Aspect.AURA, 1), - 18, - 3, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_ARMOR) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_HELM_GEM)); + LibResearch.KEY_ICHORCLOTH_HELM_GEM, + new AspectList().add(Aspect.WATER, 2).add(Aspect.HEAL, 1).add(Aspect.HUNGER, 1).add(Aspect.AURA, 1), + 18, + 3, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ARMOR).setPages( + new ResearchPage("0"), + ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_HELM_GEM)); } @Override @@ -113,16 +105,11 @@ public class ItemGemHelm extends ItemIchorclothArmorAdv implements IGoggles, IRe LibResearch.KEY_ICHORCLOTH_HELM_GEM, new ItemStack(this), 13, - new AspectList() - .add(Aspect.WATER, 50) - .add(Aspect.ARMOR, 32) - .add(Aspect.HUNGER, 32) - .add(Aspect.AURA, 32) - .add(Aspect.LIGHT, 64) - .add(Aspect.FLESH, 16) - .add(Aspect.MIND, 16), - new ItemStack(ThaumicTinkerer.registry.getItemFromClassAndName( - ItemIchorclothArmor.class, LibItemNames.ICHOR_HELM)), + new AspectList().add(Aspect.WATER, 50).add(Aspect.ARMOR, 32).add(Aspect.HUNGER, 32).add(Aspect.AURA, 32) + .add(Aspect.LIGHT, 64).add(Aspect.FLESH, 16).add(Aspect.MIND, 16), + new ItemStack( + ThaumicTinkerer.registry + .getItemFromClassAndName(ItemIchorclothArmor.class, LibItemNames.ICHOR_HELM)), new ItemStack(Items.diamond, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemLegs.java b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemLegs.java index aa1fc594..1dfa42d6 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemLegs.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemGemLegs.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 27, 2013, 1:03:05 AM (GMT)] @@ -20,6 +17,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.MathHelper; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -100,18 +98,12 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHORCLOTH_LEGS_GEM, - new AspectList() - .add(Aspect.FIRE, 2) - .add(Aspect.HEAL, 1) - .add(Aspect.GREED, 1) - .add(Aspect.ENERGY, 1), - 17, - 9, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_ARMOR) - .setPages( + LibResearch.KEY_ICHORCLOTH_LEGS_GEM, + new AspectList().add(Aspect.FIRE, 2).add(Aspect.HEAL, 1).add(Aspect.GREED, 1).add(Aspect.ENERGY, 1), + 17, + 9, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ARMOR).setPages( new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHORCLOTH_LEGS_GEM), new ResearchPage("1")); @@ -123,16 +115,11 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv { LibResearch.KEY_ICHORCLOTH_LEGS_GEM, new ItemStack(this), 13, - new AspectList() - .add(Aspect.FIRE, 50) - .add(Aspect.ARMOR, 32) - .add(Aspect.HEAL, 32) - .add(Aspect.ENERGY, 32) - .add(Aspect.LIGHT, 64) - .add(Aspect.GREED, 16) - .add(Aspect.ELDRITCH, 16), - (new ItemStack(ThaumicTinkerer.registry.getItemFromClassAndName( - ItemIchorclothArmor.class, LibItemNames.ICHOR_LEGS))), + new AspectList().add(Aspect.FIRE, 50).add(Aspect.ARMOR, 32).add(Aspect.HEAL, 32).add(Aspect.ENERGY, 32) + .add(Aspect.LIGHT, 64).add(Aspect.GREED, 16).add(Aspect.ELDRITCH, 16), + (new ItemStack( + ThaumicTinkerer.registry + .getItemFromClassAndName(ItemIchorclothArmor.class, LibItemNames.ICHOR_LEGS))), new ItemStack(Items.diamond, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmor.java b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmor.java index b3183082..0d6e6840 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmor.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmor.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 24, 2013, 9:37:40 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.armor; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -30,6 +26,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.common.ISpecialArmor; import net.minecraftforge.common.util.EnumHelper; + import thaumcraft.api.IRunicArmor; import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IWarpingGear; @@ -51,11 +48,13 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIchorclothArmor extends ItemArmor implements IVisDiscountGear, ISpecialArmor, ITTinkererItem, IWarpingGear, IRunicArmor { - static ItemArmor.ArmorMaterial material = EnumHelper.addArmorMaterial("ICHOR", 0, new int[] {3, 8, 6, 3}, 20); + static ItemArmor.ArmorMaterial material = EnumHelper.addArmorMaterial("ICHOR", 0, new int[] { 3, 8, 6, 3 }, 20); public ItemIchorclothArmor(int par2) { super(material, 0, par2); @@ -83,8 +82,11 @@ public class ItemIchorclothArmor extends ItemArmor @Override public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean par4) { - list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": " - + this.getVisDiscount(stack, player, null) + "%"); + list.add( + EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + + ": " + + this.getVisDiscount(stack, player, null) + + "%"); } @Override @@ -98,8 +100,8 @@ public class ItemIchorclothArmor extends ItemArmor } @Override - public ArmorProperties getProperties( - EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { + public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, + int slot) { return new ArmorProperties(0, getArmorMaterial().getDamageReductionAmount(slot) * 0.0425, Integer.MAX_VALUE); } @@ -156,23 +158,15 @@ public class ItemIchorclothArmor extends ItemArmor @Override public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; - return armorType != 0 - ? null + return armorType != 0 ? null : (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHORCLOTH_ARMOR, - new AspectList() - .add(Aspect.ARMOR, 2) - .add(Aspect.CLOTH, 1) - .add(Aspect.LIGHT, 1) - .add(Aspect.CRAFT, 1), - 17, - 5, - 5, - new ItemStack(this)) - .setWarp(4) - .setConcealed() - .setParents(LibResearch.KEY_ICHOR_CLOTH) - .setPages( + LibResearch.KEY_ICHORCLOTH_ARMOR, + new AspectList().add(Aspect.ARMOR, 2).add(Aspect.CLOTH, 1).add(Aspect.LIGHT, 1) + .add(Aspect.CRAFT, 1), + 17, + 5, + 5, + new ItemStack(this)).setWarp(4).setConcealed().setParents(LibResearch.KEY_ICHOR_CLOTH).setPages( new ResearchPage("0"), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHORCLOTH_HELM), ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHORCLOTH_CHEST), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmorAdv.java b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmorAdv.java index e3b64149..20ed0c0c 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmorAdv.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/armor/ItemIchorclothArmorAdv.java @@ -1,22 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 25, 2013, 12:20:05 AM (GMT)] */ package thaumic.tinkerer.common.item.kami.armor; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -24,11 +21,13 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; + import thaumcraft.api.aspects.Aspect; import thaumic.tinkerer.client.core.handler.kami.ToolModeHUDHandler; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; public abstract class ItemIchorclothArmorAdv extends ItemIchorclothArmor { @@ -54,8 +53,8 @@ public abstract class ItemIchorclothArmorAdv extends ItemIchorclothArmor { par1ItemStack.setItemDamage(~dmg & 1); par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F); - ToolModeHUDHandler.setTooltip( - StatCollector.translateToLocal("ttmisc.awakenedArmor" + par1ItemStack.getItemDamage())); + ToolModeHUDHandler + .setTooltip(StatCollector.translateToLocal("ttmisc.awakenedArmor" + par1ItemStack.getItemDamage())); return par1ItemStack; } diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusRecall.java b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusRecall.java index 5e245a95..4b6b574a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusRecall.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusRecall.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 9:20:05 PM (GMT)] @@ -18,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.ChunkCoordinates; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -41,8 +39,8 @@ import thaumic.tinkerer.common.research.ResearchHelper; public class ItemFocusRecall extends ItemModKamiFocus { - private static final AspectList visUsage = - new AspectList().add(Aspect.AIR, 4000).add(Aspect.EARTH, 4000).add(Aspect.ORDER, 4000); + private static final AspectList visUsage = new AspectList().add(Aspect.AIR, 4000).add(Aspect.EARTH, 4000) + .add(Aspect.ORDER, 4000); public ItemFocusRecall() { super(); @@ -70,8 +68,7 @@ public class ItemFocusRecall extends ItemModKamiFocus { ItemStack stackToCount = null; for (int i = 0; i < 9; i++) { ItemStack stackInSlot = paramEntityPlayer.inventory.getStackInSlot(i); - if (stackInSlot != null - && stackInSlot.getItem() instanceof ItemSkyPearl + if (stackInSlot != null && stackInSlot.getItem() instanceof ItemSkyPearl && ItemSkyPearl.isAttuned(stackInSlot)) { stackToCount = stackInSlot; break; @@ -109,15 +106,15 @@ public class ItemFocusRecall extends ItemModKamiFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal }; } return null; } @@ -134,19 +131,15 @@ public class ItemFocusRecall extends ItemModKamiFocus { } if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_FOCUS_RECALL, - new AspectList() - .add(Aspect.TRAVEL, 2) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.FLIGHT, 1) - .add(Aspect.MAGIC, 1), - 20, - 8, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_WARP_GATE) - .setParentsHidden(LibResearch.KEY_ICHORCLOTH_ROD) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_RECALL)); + LibResearch.KEY_FOCUS_RECALL, + new AspectList().add(Aspect.TRAVEL, 2).add(Aspect.ELDRITCH, 1).add(Aspect.FLIGHT, 1) + .add(Aspect.MAGIC, 1), + 20, + 8, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_WARP_GATE) + .setParentsHidden(LibResearch.KEY_ICHORCLOTH_ROD) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_RECALL)); } @Override @@ -155,10 +148,7 @@ public class ItemFocusRecall extends ItemModKamiFocus { LibResearch.KEY_FOCUS_RECALL, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemFocusRecall.class)), 10, - new AspectList() - .add(Aspect.TRAVEL, 100) - .add(Aspect.ELDRITCH, 64) - .add(Aspect.MAGIC, 50), + new AspectList().add(Aspect.TRAVEL, 100).add(Aspect.ELDRITCH, 64).add(Aspect.MAGIC, 50), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemSkyPearl.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusShadowbeam.java b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusShadowbeam.java index f73933e9..8beb3c69 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusShadowbeam.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusShadowbeam.java @@ -1,6 +1,5 @@ package thaumic.tinkerer.common.item.kami.foci; -import cpw.mods.fml.common.registry.EntityRegistry; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityThrowable; @@ -13,6 +12,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -33,11 +33,12 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.common.registry.EntityRegistry; public class ItemFocusShadowbeam extends ItemModKamiFocus { - private static final AspectList visUsage = - new AspectList().add(Aspect.ORDER, 500).add(Aspect.ENTROPY, 500).add(Aspect.AIR, 300); + private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 500).add(Aspect.ENTROPY, 500) + .add(Aspect.AIR, 300); private static final int DAMAGE = 100; @@ -90,15 +91,15 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemstack, int rank) { switch (rank) { case 1: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 2: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 3: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 4: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; case 5: - return new FocusUpgradeType[] {FocusUpgradeType.frugal, FocusUpgradeType.potency}; + return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency }; } return null; } @@ -117,18 +118,14 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_FOCUS_SHADOWBEAM, - new AspectList() - .add(Aspect.DARKNESS, 2) - .add(Aspect.MAGIC, 1) - .add(Aspect.ELDRITCH, 1) - .add(Aspect.TAINT, 1), - 14, - 4, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_ROD) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_SHADOWBEAM)); + LibResearch.KEY_FOCUS_SHADOWBEAM, + new AspectList().add(Aspect.DARKNESS, 2).add(Aspect.MAGIC, 1).add(Aspect.ELDRITCH, 1) + .add(Aspect.TAINT, 1), + 14, + 4, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ROD) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_SHADOWBEAM)); } @Override @@ -137,10 +134,7 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { LibResearch.KEY_FOCUS_SHADOWBEAM, new ItemStack(this), 12, - new AspectList() - .add(Aspect.DARKNESS, 65) - .add(Aspect.ELDRITCH, 32) - .add(Aspect.MAGIC, 50) + new AspectList().add(Aspect.DARKNESS, 65).add(Aspect.ELDRITCH, 32).add(Aspect.MAGIC, 50) .add(Aspect.WEAPON, 32), new ItemStack(ConfigItems.itemFocusShock), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), @@ -153,15 +147,7 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { public static class Particle extends FXSparkle { - public Particle( - World world, - double x, - double y, - double z, - float scale, - float red, - float green, - float blue, + public Particle(World world, double x, double y, double z, float scale, float red, float green, float blue, int maxAge) { super(world, x, y, z, scale, red, green, blue, 1); this.particleMaxAge /= 3; @@ -174,32 +160,32 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { this.noClip = true; this.setGravity(-0.7f); ////////////////////////////////////////////////// - // For more check the parent class + // For more check the parent class ////////////////////////////////////////////////// - // this.leyLineEffect = false; - // this.multiplier = 2; - // this.shrink = true; - // this.particle = 16; - // this.tinkle = false; - // this.blendmode = 1; - // this.slowdown = true; - // this.currentColor = 0; - // if(f1 == 0.0F) { - // f1 = 1.0F; - // } - // this.particleRed = f1; - // this.particleGreen = f2; - // this.particleBlue = f3; - // this.particleGravity = 0.0F; - // this.motionX = this.motionY = this.motionZ = 0.0D; - // this.particleScale *= f; - // this.particleMaxAge = 3 * m; - // this.multiplier = m; - // this.noClip = false; - // this.setSize(0.01F, 0.01F); - // this.prevPosX = this.posX; - // this.prevPosY = this.posY; - // this.prevPosZ = this.posZ; + // this.leyLineEffect = false; + // this.multiplier = 2; + // this.shrink = true; + // this.particle = 16; + // this.tinkle = false; + // this.blendmode = 1; + // this.slowdown = true; + // this.currentColor = 0; + // if(f1 == 0.0F) { + // f1 = 1.0F; + // } + // this.particleRed = f1; + // this.particleGreen = f2; + // this.particleBlue = f3; + // this.particleGravity = 0.0F; + // this.motionX = this.motionY = this.motionZ = 0.0D; + // this.particleScale *= f; + // this.particleMaxAge = 3 * m; + // this.multiplier = m; + // this.noClip = false; + // this.setSize(0.01F, 0.01F); + // this.prevPosX = this.posX; + // this.prevPosY = this.posY; + // this.prevPosZ = this.posZ; ////////////////////////////////////////////////// } } @@ -262,13 +248,13 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { if (movingobjectposition.entityHit != null) { if ((MinecraftServer.getServer().isPVPEnabled() - || !(movingobjectposition.entityHit instanceof EntityPlayer)) + || !(movingobjectposition.entityHit instanceof EntityPlayer)) && movingobjectposition.entityHit != getThrower() && getThrower() instanceof EntityPlayer && !movingobjectposition.entityHit.worldObj.isRemote) { int fullDamage = (potency > 0) ? (int) (DAMAGE + DAMAGE * (0.2 * potency)) : DAMAGE; - movingobjectposition.entityHit.attackEntityFrom( - DamageSource.causePlayerDamage((EntityPlayer) getThrower()), fullDamage); + movingobjectposition.entityHit + .attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) getThrower()), fullDamage); } return; } @@ -277,9 +263,7 @@ public class ItemFocusShadowbeam extends ItemModKamiFocus { ForgeDirection dir = ForgeDirection.getOrientation(movingobjectposition.sideHit); Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize(); - movementVector = normalVector - .multiply(-2 * movementVec.dotProduct(normalVector)) - .add(movementVec); + movementVector = normalVector.multiply(-2 * movementVec.dotProduct(normalVector)).add(movementVec); motionX = movementVector.x; motionY = movementVector.y; diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusXPDrain.java b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusXPDrain.java index 6e27bcef..4634e100 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusXPDrain.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemFocusXPDrain.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.item.kami.foci; import java.awt.*; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -9,6 +10,7 @@ import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -91,8 +93,12 @@ public class ItemFocusXPDrain extends ItemModKamiFocus { @Override protected void addVisCostTooltip(AspectList cost, ItemStack stack, EntityPlayer player, List list, boolean par4) { list.add(StatCollector.translateToLocal(isVisCostPerTick(stack) ? "item.Focus.cost2" : "item.Focus.cost1")); - list.add(" " + EnumChatFormatting.GREEN + StatCollector.translateToLocal("ttmisc.experience") - + EnumChatFormatting.WHITE + " x " + getXpUse(stack)); + list.add( + " " + EnumChatFormatting.GREEN + + StatCollector.translateToLocal("ttmisc.experience") + + EnumChatFormatting.WHITE + + " x " + + getXpUse(stack)); } @Override @@ -119,18 +125,13 @@ public class ItemFocusXPDrain extends ItemModKamiFocus { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_FOCUS_XP_DRAIN, - new AspectList() - .add(Aspect.MIND, 2) - .add(Aspect.MAGIC, 1) - .add(Aspect.AURA, 1) - .add(Aspect.MAN, 1), - 12, - 3, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHORCLOTH_ROD) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_XP_DRAIN)); + LibResearch.KEY_FOCUS_XP_DRAIN, + new AspectList().add(Aspect.MIND, 2).add(Aspect.MAGIC, 1).add(Aspect.AURA, 1).add(Aspect.MAN, 1), + 12, + 3, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHORCLOTH_ROD) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_XP_DRAIN)); } @Override @@ -139,11 +140,7 @@ public class ItemFocusXPDrain extends ItemModKamiFocus { LibResearch.KEY_FOCUS_XP_DRAIN, new ItemStack(this), 12, - new AspectList() - .add(Aspect.MIND, 65) - .add(Aspect.TAINT, 16) - .add(Aspect.MAGIC, 50) - .add(Aspect.AURA, 32), + new AspectList().add(Aspect.MIND, 65).add(Aspect.TAINT, 16).add(Aspect.MAGIC, 50).add(Aspect.AURA, 32), new ItemStack(Items.ender_pearl), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), new ItemStack(Items.experience_bottle), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemModKamiFocus.java b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemModKamiFocus.java index 37f09f90..2f962c11 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemModKamiFocus.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/foci/ItemModKamiFocus.java @@ -1,23 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 19:22:59 (GMT)] */ package thaumic.tinkerer.common.item.kami.foci; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -25,6 +21,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; @@ -33,6 +30,8 @@ import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.registry.ITTinkererItem; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class ItemModKamiFocus extends ItemFocusBasic implements ITTinkererItem { @@ -99,10 +98,10 @@ public abstract class ItemModKamiFocus extends ItemFocusBasic implements ITTinke } protected void addVisCostTooltip(AspectList cost, ItemStack stack, EntityPlayer player, List list, boolean par4) { - /*for (Aspect aspect : cost.getAspectsSorted()) { - float amount = cost.getAmount(aspect) / 100.0F; - list.add(" " + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount); - }*/ + /* + * for (Aspect aspect : cost.getAspectsSorted()) { float amount = cost.getAmount(aspect) / 100.0F; list.add(" " + * + '\u00a7' + aspect.getChatcolor() + aspect.getName() + '\u00a7' + "r x " + amount); } + */ } @Override @@ -135,10 +134,7 @@ public abstract class ItemModKamiFocus extends ItemFocusBasic implements ITTinke } @Override - public ItemStack onFocusRightClick( - ItemStack paramItemStack, - World paramWorld, - EntityPlayer paramEntityPlayer, + public ItemStack onFocusRightClick(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, MovingObjectPosition paramMovingObjectPosition) { if (isUseItem(paramItemStack)) paramEntityPlayer.setItemInUse(paramItemStack, Integer.MAX_VALUE); @@ -151,8 +147,8 @@ public abstract class ItemModKamiFocus extends ItemFocusBasic implements ITTinke } @Override - public void onPlayerStoppedUsingFocus( - ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt) { + public void onPlayerStoppedUsingFocus(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, + int paramInt) { // NO-OP } @@ -162,8 +158,8 @@ public abstract class ItemModKamiFocus extends ItemFocusBasic implements ITTinke } @Override - public boolean onFocusBlockStartBreak( - ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, EntityPlayer paramEntityPlayer) { + public boolean onFocusBlockStartBreak(ItemStack paramItemStack, int paramInt1, int paramInt2, int paramInt3, + EntityPlayer paramEntityPlayer) { return false; } diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/IAdvancedTool.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/IAdvancedTool.java index 2dbcda3f..b709a23f 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/IAdvancedTool.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/IAdvancedTool.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 6:03:41 PM (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxe.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxe.java index 22283360..849a238d 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxe.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxe.java @@ -1,26 +1,23 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 5:29:45 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.tool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigItems; @@ -36,6 +33,8 @@ import thaumic.tinkerer.common.registry.ITTinkererItem; import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIchorAxe extends ItemAxe implements ITTinkererItem { diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxeAdv.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxeAdv.java index 8c4897d3..7319d727 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxeAdv.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorAxeAdv.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 8:24:43 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.item.kami.tool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -30,6 +28,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -106,7 +105,8 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool { } List items = world.getEntitiesWithinAABB( - EntityItem.class, AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5)); + EntityItem.class, + AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5)); for (EntityItem item : items) { item.setPosition(x + 0.5, y + 0.5, z + 0.5); item.ticksExisted += 20; @@ -165,18 +165,13 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHOR_AXE_GEM, - new AspectList() - .add(Aspect.WATER, 2) - .add(Aspect.TOOL, 1) - .add(Aspect.TREE, 1) - .add(Aspect.CROP, 1), - 16, - 14, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_TOOLS) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_AXE_GEM)); + LibResearch.KEY_ICHOR_AXE_GEM, + new AspectList().add(Aspect.WATER, 2).add(Aspect.TOOL, 1).add(Aspect.TREE, 1).add(Aspect.CROP, 1), + 16, + 14, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_TOOLS) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_AXE_GEM)); } @Override @@ -185,14 +180,8 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool { LibResearch.KEY_ICHOR_AXE_GEM, new ItemStack(this), 15, - new AspectList() - .add(Aspect.WATER, 50) - .add(Aspect.MINE, 64) - .add(Aspect.TOOL, 32) - .add(Aspect.TREE, 32) - .add(Aspect.HARVEST, 32) - .add(Aspect.CROP, 16) - .add(Aspect.SENSES, 16), + new AspectList().add(Aspect.WATER, 50).add(Aspect.MINE, 64).add(Aspect.TOOL, 32).add(Aspect.TREE, 32) + .add(Aspect.HARVEST, 32).add(Aspect.CROP, 16).add(Aspect.SENSES, 16), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemIchorAxe.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPick.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPick.java index 59822023..0fe2d307 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPick.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPick.java @@ -1,26 +1,23 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 5:29:41 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.tool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -39,6 +36,8 @@ import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; import thaumic.tinkerer.common.research.KamiResearchItem; import thaumic.tinkerer.common.research.ResearchHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIchorPick extends ItemPickaxe implements ITTinkererItem { @@ -89,26 +88,18 @@ public class ItemIchorPick extends ItemPickaxe implements ITTinkererItem { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHOR_TOOLS, - new AspectList() - .add(Aspect.TOOL, 2) - .add(Aspect.WEAPON, 1) - .add(Aspect.METAL, 1) - .add(Aspect.CRAFT, 1), - 13, - 12, - 5, - new ItemStack(this)) - .setWarp(2) - .setConcealed() - .setParents(LibResearch.KEY_ICHORIUM) - .setParentsHidden(LibResearch.KEY_ICHORCLOTH_ROD) - .setPages( - new ResearchPage("0"), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_PICK), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_SHOVEL), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_AXE), - ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_SWORD)); + LibResearch.KEY_ICHOR_TOOLS, + new AspectList().add(Aspect.TOOL, 2).add(Aspect.WEAPON, 1).add(Aspect.METAL, 1).add(Aspect.CRAFT, 1), + 13, + 12, + 5, + new ItemStack(this)).setWarp(2).setConcealed().setParents(LibResearch.KEY_ICHORIUM) + .setParentsHidden(LibResearch.KEY_ICHORCLOTH_ROD).setPages( + new ResearchPage("0"), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_PICK), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_SHOVEL), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_AXE), + ResearchHelper.arcaneRecipePage(LibResearch.KEY_ICHOR_SWORD)); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPickAdv.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPickAdv.java index c3ce3818..1d21c1f6 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPickAdv.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorPickAdv.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 6:01:04 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.item.kami.tool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -28,6 +26,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -106,14 +105,12 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool { ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit); int fortune = EnchantmentHelper.getFortuneModifier(player); boolean silk = EnchantmentHelper.getSilkTouchModifier(player); - if (ConfigHandler.bedrockDimensionID != 0 - && blk == Blocks.bedrock + if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock && ((world.provider.isSurfaceWorld() && y < 5) || (y > 253 && world.provider instanceof WorldProviderBedrock))) { world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class)); } - if (ConfigHandler.bedrockDimensionID != 0 - && blk == Blocks.bedrock + if (ConfigHandler.bedrockDimensionID != 0 && blk == Blocks.bedrock && (y <= 253 && world.provider instanceof WorldProviderBedrock)) { world.setBlock(x, y, z, Blocks.air); } @@ -190,18 +187,12 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHOR_PICK_GEM, - new AspectList() - .add(Aspect.FIRE, 2) - .add(Aspect.TOOL, 1) - .add(Aspect.MINE, 1) - .add(Aspect.EARTH, 1), - 13, - 15, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_TOOLS) - .setPages( + LibResearch.KEY_ICHOR_PICK_GEM, + new AspectList().add(Aspect.FIRE, 2).add(Aspect.TOOL, 1).add(Aspect.MINE, 1).add(Aspect.EARTH, 1), + 13, + 15, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_TOOLS).setPages( new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_PICK_GEM), new ResearchPage("1")); @@ -213,14 +204,8 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool { LibResearch.KEY_ICHOR_PICK_GEM, new ItemStack(this), 15, - new AspectList() - .add(Aspect.FIRE, 50) - .add(Aspect.MINE, 64) - .add(Aspect.METAL, 32) - .add(Aspect.EARTH, 32) - .add(Aspect.HARVEST, 32) - .add(Aspect.GREED, 16) - .add(Aspect.SENSES, 16), + new AspectList().add(Aspect.FIRE, 50).add(Aspect.MINE, 64).add(Aspect.METAL, 32).add(Aspect.EARTH, 32) + .add(Aspect.HARVEST, 32).add(Aspect.GREED, 16).add(Aspect.SENSES, 16), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemIchorPick.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovel.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovel.java index e80670d3..122eba02 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovel.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovel.java @@ -1,26 +1,23 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 5:29:36 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.tool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigItems; @@ -36,6 +33,8 @@ import thaumic.tinkerer.common.registry.ITTinkererItem; import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIchorShovel extends ItemSpade implements ITTinkererItem { diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovelAdv.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovelAdv.java index fba5bffd..cc46e45d 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovelAdv.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorShovelAdv.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 7:37:10 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.item.kami.tool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -28,6 +26,7 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -116,7 +115,21 @@ public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool case 2: { Block blk = world.getBlock(x, y, z); ToolHandler.removeBlocksInIteration( - player, world, x, y, z, 0, -8, 0, 1, 8, 1, blk, ToolHandler.materialsShovel, silk, fortune); + player, + world, + x, + y, + z, + 0, + -8, + 0, + 1, + 8, + 1, + blk, + ToolHandler.materialsShovel, + silk, + fortune); break; } } @@ -142,18 +155,13 @@ public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHOR_SHOVEL_GEM, - new AspectList() - .add(Aspect.EARTH, 2) - .add(Aspect.TOOL, 1) - .add(Aspect.MINE, 1) - .add(Aspect.EARTH, 1), - 15, - 15, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_TOOLS) - .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_SHOVEL_GEM)); + LibResearch.KEY_ICHOR_SHOVEL_GEM, + new AspectList().add(Aspect.EARTH, 2).add(Aspect.TOOL, 1).add(Aspect.MINE, 1).add(Aspect.EARTH, 1), + 15, + 15, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_TOOLS) + .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_SHOVEL_GEM)); } @Override @@ -162,14 +170,8 @@ public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool LibResearch.KEY_ICHOR_SHOVEL_GEM, new ItemStack(this), 15, - new AspectList() - .add(Aspect.EARTH, 50) - .add(Aspect.MINE, 64) - .add(Aspect.TOOL, 32) - .add(Aspect.EARTH, 32) - .add(Aspect.HARVEST, 32) - .add(Aspect.TRAP, 16) - .add(Aspect.SENSES, 16), + new AspectList().add(Aspect.EARTH, 50).add(Aspect.MINE, 64).add(Aspect.TOOL, 32).add(Aspect.EARTH, 32) + .add(Aspect.HARVEST, 32).add(Aspect.TRAP, 16).add(Aspect.SENSES, 16), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemIchorShovel.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSword.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSword.java index ceda675c..453e0b59 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSword.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSword.java @@ -1,26 +1,23 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 5:29:49 PM (GMT)] */ package thaumic.tinkerer.common.item.kami.tool; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigItems; @@ -36,6 +33,8 @@ import thaumic.tinkerer.common.registry.ITTinkererItem; import thaumic.tinkerer.common.registry.ThaumicTinkererArcaneRecipe; import thaumic.tinkerer.common.registry.ThaumicTinkererRecipe; import thaumic.tinkerer.common.research.IRegisterableResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ItemIchorSword extends ItemSword implements ITTinkererItem { diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSwordAdv.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSwordAdv.java index e07e0ac2..6125ab5e 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSwordAdv.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ItemIchorSwordAdv.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 9:08:14 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.item.kami.tool; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -28,6 +26,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; @@ -74,39 +73,38 @@ public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool { @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - if (!ignoreLeftClick - && entity instanceof EntityLivingBase + if (!ignoreLeftClick && entity instanceof EntityLivingBase && ((EntityLivingBase) entity).hurtTime == 0 && !((EntityLivingBase) entity).isDead) switch (ToolHandler.getMode(stack)) { - case 0: - break; - case 1: { - int range = 3; - List entities = player.worldObj.getEntitiesWithinAABB( - entity.getClass(), - AxisAlignedBB.getBoundingBox( - entity.posX - range, - entity.posY - range, - entity.posZ - range, - entity.posX + range, - entity.posY + range, - entity.posZ + range)); - ignoreLeftClick = true; - for (Entity entity_ : entities) player.attackTargetEntityWithCurrentItem(entity_); - ignoreLeftClick = false; + case 0: + break; + case 1: { + int range = 3; + List entities = player.worldObj.getEntitiesWithinAABB( + entity.getClass(), + AxisAlignedBB.getBoundingBox( + entity.posX - range, + entity.posY - range, + entity.posZ - range, + entity.posX + range, + entity.posY + range, + entity.posZ + range)); + ignoreLeftClick = true; + for (Entity entity_ : entities) player.attackTargetEntityWithCurrentItem(entity_); + ignoreLeftClick = false; - break; - } - case 2: { - EntityLivingBase living = (EntityLivingBase) entity; - PotionEffect effect = new PotionEffect(Potion.resistance.id, 1, 1); - living.addPotionEffect(effect); + break; + } + case 2: { + EntityLivingBase living = (EntityLivingBase) entity; + PotionEffect effect = new PotionEffect(Potion.resistance.id, 1, 1); + living.addPotionEffect(effect); - SoulHeartHandler.addHearts(player); + SoulHeartHandler.addHearts(player); - break; - } + break; + } } return super.onLeftClickEntity(stack, player, entity); @@ -138,18 +136,12 @@ public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool { public IRegisterableResearch getResearchItem() { if (!ConfigHandler.enableKami) return null; return (IRegisterableResearch) new KamiResearchItem( - LibResearch.KEY_ICHOR_SWORD_GEM, - new AspectList() - .add(Aspect.AIR, 2) - .add(Aspect.WEAPON, 1) - .add(Aspect.SOUL, 1) - .add(Aspect.HUNGER, 1), - 16, - 12, - 5, - new ItemStack(this)) - .setParents(LibResearch.KEY_ICHOR_TOOLS) - .setPages( + LibResearch.KEY_ICHOR_SWORD_GEM, + new AspectList().add(Aspect.AIR, 2).add(Aspect.WEAPON, 1).add(Aspect.SOUL, 1).add(Aspect.HUNGER, 1), + 16, + 12, + 5, + new ItemStack(this)).setParents(LibResearch.KEY_ICHOR_TOOLS).setPages( new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_ICHOR_SWORD_GEM), new ResearchPage("1")); @@ -161,14 +153,8 @@ public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool { LibResearch.KEY_ICHOR_SWORD_GEM, new ItemStack(this), 15, - new AspectList() - .add(Aspect.AIR, 50) - .add(Aspect.HUNGER, 64) - .add(Aspect.SOUL, 32) - .add(Aspect.WEAPON, 32) - .add(Aspect.ENERGY, 32) - .add(Aspect.ORDER, 16) - .add(Aspect.CRYSTAL, 16), + new AspectList().add(Aspect.AIR, 50).add(Aspect.HUNGER, 64).add(Aspect.SOUL, 32).add(Aspect.WEAPON, 32) + .add(Aspect.ENERGY, 32).add(Aspect.ORDER, 16).add(Aspect.CRYSTAL, 16), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemIchorSword.class)), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class)), diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ToolHandler.java b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ToolHandler.java index 403d53d0..2b44f61d 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/tool/ToolHandler.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/tool/ToolHandler.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 6:01:31 PM (GMT)] @@ -15,6 +12,7 @@ package thaumic.tinkerer.common.item.kami.tool; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; @@ -30,6 +28,7 @@ import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.event.world.BlockEvent; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.kami.BlockBedrockPortal; import thaumic.tinkerer.common.core.handler.ConfigHandler; @@ -37,14 +36,12 @@ import thaumic.tinkerer.common.dim.WorldProviderBedrock; public final class ToolHandler { - public static Material[] materialsPick = - new Material[] {Material.rock, Material.iron, Material.ice, Material.glass, Material.piston, Material.anvil - }; - public static Material[] materialsShovel = new Material[] { - Material.grass, Material.ground, Material.sand, Material.snow, Material.craftedSnow, Material.clay - }; - public static Material[] materialsAxe = - new Material[] {Material.coral, Material.leaves, Material.plants, Material.wood}; + public static Material[] materialsPick = new Material[] { Material.rock, Material.iron, Material.ice, + Material.glass, Material.piston, Material.anvil }; + public static Material[] materialsShovel = new Material[] { Material.grass, Material.ground, Material.sand, + Material.snow, Material.craftedSnow, Material.clay }; + public static Material[] materialsAxe = new Material[] { Material.coral, Material.leaves, Material.plants, + Material.wood }; public static int getMode(ItemStack tool) { return tool.getItemDamage(); @@ -61,28 +58,14 @@ public final class ToolHandler { public static boolean isRightMaterial(Material material, Material[] materialsListing) { // if(material.isToolNotRequired()) - // return true; + // return true; for (Material mat : materialsListing) if (material == mat) return true; return false; } - public static void removeBlocksInIteration( - EntityPlayer player, - World world, - int x, - int y, - int z, - int xs, - int ys, - int zs, - int xe, - int ye, - int ze, - Block block, - Material[] materialsListing, - boolean silk, - int fortune) { + public static void removeBlocksInIteration(EntityPlayer player, World world, int x, int y, int z, int xs, int ys, + int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean silk, int fortune) { MovingObjectPosition mop = raytraceFromEntity(player.worldObj, player, false, 4.5d); if (mop == null) return; int sideHit = mop.sideHit; @@ -99,23 +82,16 @@ public final class ToolHandler { } } List list = world.getEntitiesWithinAABB( - EntityItem.class, AxisAlignedBB.getBoundingBox(x + xs, y + ys, z + zs, x + xe, y + ye, z + ze)); + EntityItem.class, + AxisAlignedBB.getBoundingBox(x + xs, y + ys, z + zs, x + xe, y + ye, z + ze)); for (Object entity : list) { EntityItem item = (EntityItem) entity; item.setPosition(player.posX, player.posY + 1, player.posZ); } } - protected static void breakExtraBlock( - World world, - int x, - int y, - int z, - EntityPlayer playerEntity, - int refX, - int refY, - int refZ, - Material[] materialsListing) { + protected static void breakExtraBlock(World world, int x, int y, int z, EntityPlayer playerEntity, int refX, + int refY, int refZ, Material[] materialsListing) { if (world.isAirBlock(x, y, z)) return; // what? @@ -131,12 +107,12 @@ public final class ToolHandler { float strength = ForgeHooks.blockStrength(block, player, world, x, y, z); // only harvestable blocks that aren't impossibly slow to harvest - // if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f) - // return; + // if (!ForgeHooks.canHarvestBlock(block, player, meta) || refStrength/strength > 10f) + // return; // send the blockbreak event - BlockEvent.BreakEvent event = - ForgeHooks.onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z); + BlockEvent.BreakEvent event = ForgeHooks + .onBlockBreakEvent(world, player.theItemInWorldManager.getGameType(), player, x, y, z); if (event.isCanceled()) return; if (player.capabilities.isCreativeMode) { @@ -161,8 +137,8 @@ public final class ToolHandler { // ItemInWorldManager.removeBlock block.onBlockHarvested(world, x, y, z, meta, player); - if (block.removedByPlayer( - world, player, x, y, z, true)) // boolean is if block can be harvested, checked above + if (block.removedByPlayer(world, player, x, y, z, true)) // boolean is if block can be harvested, checked + // above { block.onBlockDestroyedByPlayer(world, x, y, z, meta); if (block != Blocks.bedrock) block.harvestBlock(world, player, x, y, z, meta); @@ -186,27 +162,13 @@ public final class ToolHandler { block.onBlockDestroyedByPlayer(world, x, y, z, meta); } - Minecraft.getMinecraft() - .getNetHandler() - .addToSendQueue( - new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit)); + Minecraft.getMinecraft().getNetHandler().addToSendQueue( + new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit)); } } - public static void removeBlockWithDrops( - EntityPlayer player, - World world, - int x, - int y, - int z, - int bx, - int by, - int bz, - Block block, - Material[] materialsListing, - boolean silk, - int fortune, - float blockHardness, + public static void removeBlockWithDrops(EntityPlayer player, World world, int x, int y, int z, int bx, int by, + int bz, Block block, Material[] materialsListing, boolean silk, int fortune, float blockHardness, int metadata) { if (!world.blockExists(x, y, z)) return; @@ -216,19 +178,16 @@ public final class ToolHandler { int meta = world.getBlockMetadata(x, y, z); Material mat = world.getBlock(x, y, z).getMaterial(); - if (blk != null - && !blk.isAir(world, x, y, z) + if (blk != null && !blk.isAir(world, x, y, z) && ((blk.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0 || (blk == Blocks.bedrock && (y <= 253 && world.provider instanceof WorldProviderBedrock))))) { if (!blk.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing)) return; - if (ConfigHandler.bedrockDimensionID != 0 - && block == Blocks.bedrock + if (ConfigHandler.bedrockDimensionID != 0 && block == Blocks.bedrock && ((world.provider.isSurfaceWorld() && y < 5) || (y > 253 && world.provider instanceof WorldProviderBedrock))) { world.setBlock(x, y, z, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockBedrockPortal.class)); } - if (ConfigHandler.bedrockDimensionID != 0 - && world.provider.dimensionId == ConfigHandler.bedrockDimensionID + if (ConfigHandler.bedrockDimensionID != 0 && world.provider.dimensionId == ConfigHandler.bedrockDimensionID && blk == Blocks.bedrock && y <= 253) { world.setBlock(x, y, z, Blocks.air); diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/wand/CapIchor.java b/src/main/java/thaumic/tinkerer/common/item/kami/wand/CapIchor.java index f4887b95..ad9b59c2 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/wand/CapIchor.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/wand/CapIchor.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 22, 2013, 7:10:45 PM (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.item.kami.wand; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.wands.WandCap; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.ThaumicTinkerer; diff --git a/src/main/java/thaumic/tinkerer/common/item/kami/wand/RodIchorcloth.java b/src/main/java/thaumic/tinkerer/common/item/kami/wand/RodIchorcloth.java index 020d1177..7d7d4942 100644 --- a/src/main/java/thaumic/tinkerer/common/item/kami/wand/RodIchorcloth.java +++ b/src/main/java/thaumic/tinkerer/common/item/kami/wand/RodIchorcloth.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 22, 2013, 7:40:37 PM (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.item.kami.wand; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.wands.WandRod; import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.ThaumicTinkerer; diff --git a/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartz.java b/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartz.java index b4c896a8..9ddc5e6a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartz.java +++ b/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartz.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.item.quartz; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; import thaumic.tinkerer.common.lib.LibItemNames; @@ -15,6 +16,7 @@ import thaumic.tinkerer.common.research.ResearchHelper; import thaumic.tinkerer.common.research.TTResearchItem; public class ItemDarkQuartz extends ItemBase { + @Override public String getItemName() { return LibItemNames.DARK_QUARTZ; @@ -27,8 +29,13 @@ public class ItemDarkQuartz extends ItemBase { @Override public IRegisterableResearch getResearchItem() { - IRegisterableResearch researchItem = (IRegisterableResearch) - new TTResearchItem(LibResearch.KEY_DARK_QUARTZ, new AspectList(), -2, 2, 0, new ItemStack(this)) + IRegisterableResearch researchItem = (IRegisterableResearch) new TTResearchItem( + LibResearch.KEY_DARK_QUARTZ, + new AspectList(), + -2, + 2, + 0, + new ItemStack(this)) .setPages( new ResearchPage("0"), ResearchHelper.recipePage(LibResearch.KEY_DARK_QUARTZ + 0), @@ -37,10 +44,7 @@ public class ItemDarkQuartz extends ItemBase { ResearchHelper.recipePage(LibResearch.KEY_DARK_QUARTZ + 3), ResearchHelper.recipePage(LibResearch.KEY_DARK_QUARTZ + 4), ResearchHelper.recipePage(LibResearch.KEY_DARK_QUARTZ + 5)) - .setStub() - .setAutoUnlock() - .setRound() - .registerResearchItem(); + .setStub().setAutoUnlock().setRound().registerResearchItem(); return researchItem; } diff --git a/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzBlock.java b/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzBlock.java index b708f76b..8d017e58 100644 --- a/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzBlock.java +++ b/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzBlock.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 16:12:29 (GMT)] @@ -15,9 +12,11 @@ package thaumic.tinkerer.common.item.quartz; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.item.ItemMultiTexture; import net.minecraft.item.ItemStack; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.quartz.BlockDarkQuartz; import thaumic.tinkerer.common.lib.LibBlockNames; @@ -32,13 +31,12 @@ public class ItemDarkQuartzBlock extends ItemMultiTexture implements ITTinkererI super( ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartz.class), ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartz.class), - new String[] {""}); + new String[] { "" }); } @Override public String getUnlocalizedName(ItemStack par1ItemStack) { - return par1ItemStack.getItemDamage() >= 3 - ? "" + return par1ItemStack.getItemDamage() >= 3 ? "" : LibBlockNames.DARK_QUARTZ_BLOCK_NAMES[par1ItemStack.getItemDamage()]; } diff --git a/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzSlab.java b/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzSlab.java index 8810470a..feff975a 100644 --- a/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzSlab.java +++ b/src/main/java/thaumic/tinkerer/common/item/quartz/ItemDarkQuartzSlab.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 16:13:21 (GMT)] @@ -15,9 +12,11 @@ package thaumic.tinkerer.common.item.quartz; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.item.ItemSlab; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.quartz.BlockDarkQuartzSlab; import thaumic.tinkerer.common.lib.LibBlockNames; @@ -31,9 +30,7 @@ public class ItemDarkQuartzSlab extends ItemSlab implements ITTinkererItem { super( par1, (BlockSlab) ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartzSlab.class), - (BlockSlab) ThaumicTinkerer.registry - .getBlockFromClass(BlockDarkQuartzSlab.class) - .get(1), + (BlockSlab) ThaumicTinkerer.registry.getBlockFromClass(BlockDarkQuartzSlab.class).get(1), false); } diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibBlockIDs.java b/src/main/java/thaumic/tinkerer/common/lib/LibBlockIDs.java index 768cd03e..316e1654 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibBlockIDs.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibBlockIDs.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 17:47:21 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibBlockNames.java b/src/main/java/thaumic/tinkerer/common/lib/LibBlockNames.java index ade62f2e..94da1856 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibBlockNames.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibBlockNames.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 17:48:11 (GMT)] @@ -58,9 +55,8 @@ public final class LibBlockNames { public static final String PORTAL = "bedrockPortal"; - public static final String[] DARK_QUARTZ_BLOCK_NAMES = { - "tile." + DARK_QUARTZ, "tile." + "darkQuartzChiseled", "tile." + "darkQuartzPillar" - }; + public static final String[] DARK_QUARTZ_BLOCK_NAMES = { "tile." + DARK_QUARTZ, "tile." + "darkQuartzChiseled", + "tile." + "darkQuartzPillar" }; public static final String MOBILIZER_RELAY = "Levitational Locomotive Relay"; public static final String SPAWNER = "spawner"; diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibEnchantIDs.java b/src/main/java/thaumic/tinkerer/common/lib/LibEnchantIDs.java index ea0a8f73..2153a14b 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibEnchantIDs.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibEnchantIDs.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 11:09:54 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibEnchantNames.java b/src/main/java/thaumic/tinkerer/common/lib/LibEnchantNames.java index 3a893dc1..10861c51 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibEnchantNames.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibEnchantNames.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Sep 2013, 11:06:22 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibFeatures.java b/src/main/java/thaumic/tinkerer/common/lib/LibFeatures.java index 47f7e13d..6de7a41d 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibFeatures.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibFeatures.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 19:01:53 (GMT)] @@ -18,8 +15,8 @@ import thaumcraft.api.aspects.Aspect; public final class LibFeatures { - public static final Aspect[] PRIMAL_ASPECTS = - new Aspect[] {Aspect.AIR, Aspect.EARTH, Aspect.FIRE, Aspect.WATER, Aspect.ORDER, Aspect.ENTROPY}; + public static final Aspect[] PRIMAL_ASPECTS = new Aspect[] { Aspect.AIR, Aspect.EARTH, Aspect.FIRE, Aspect.WATER, + Aspect.ORDER, Aspect.ENTROPY }; public static final int INTERFACE_DISTANCE = 4; public static final int DISLOCATOR_DISTANCE = 16; diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibGuiIDs.java b/src/main/java/thaumic/tinkerer/common/lib/LibGuiIDs.java index 21bc2df2..4503fb7e 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibGuiIDs.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibGuiIDs.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:25:27 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibItemNames.java b/src/main/java/thaumic/tinkerer/common/lib/LibItemNames.java index 30f1b495..afd001aa 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibItemNames.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibItemNames.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 17:45:44 (GMT)] @@ -68,9 +65,8 @@ public final class LibItemNames { public static final String SWORD = "mobSword"; public static final String MOB_ASPECT = "mobAspect"; public static final String MOB_DISPLAY = "mobDisplay"; - public static final String[] KAMI_RESOURCE_NAMES = new String[] { - "ichor", "ichorCloth", "ichorium", "ichorNugget", "ichorCap", "ichorclothRod", "netherShard", "enderShard" - }; + public static final String[] KAMI_RESOURCE_NAMES = new String[] { "ichor", "ichorCloth", "ichorium", "ichorNugget", + "ichorCap", "ichorclothRod", "netherShard", "enderShard" }; public static final String INFUSED_POTION = "infusedPotion"; public static final String INFUSED_GRAIN = "infusedGrain"; diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibMisc.java b/src/main/java/thaumic/tinkerer/common/lib/LibMisc.java index 6b994fc0..192ccc54 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibMisc.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibMisc.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:02:26 (GMT)] @@ -22,8 +19,7 @@ public final class LibMisc { public static final String NETWORK_CHANNEL = MOD_ID; - public static final String DEPENDENCIES = - "required-after:Forge@[10.12.1.1112,);required-after:Thaumcraft;before:advthaum;after:IC2;after:Waila;after:ForgeMultipart;after:ComputerCraft"; + public static final String DEPENDENCIES = "required-after:Forge@[10.12.1.1112,);required-after:Thaumcraft;before:advthaum;after:IC2;after:Waila;after:ForgeMultipart;after:ComputerCraft"; public static final String COMMON_PROXY = "thaumic.tinkerer.common.core.proxy.TTCommonProxy"; public static final String CLIENT_PROXY = "thaumic.tinkerer.client.core.proxy.TTClientProxy"; diff --git a/src/main/java/thaumic/tinkerer/common/lib/LibResearch.java b/src/main/java/thaumic/tinkerer/common/lib/LibResearch.java index d7a57c68..da7bc93e 100644 --- a/src/main/java/thaumic/tinkerer/common/lib/LibResearch.java +++ b/src/main/java/thaumic/tinkerer/common/lib/LibResearch.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 16:39:00 (GMT)] diff --git a/src/main/java/thaumic/tinkerer/common/multipart/MultipartHandler.java b/src/main/java/thaumic/tinkerer/common/multipart/MultipartHandler.java index 35dab481..da977830 100644 --- a/src/main/java/thaumic/tinkerer/common/multipart/MultipartHandler.java +++ b/src/main/java/thaumic/tinkerer/common/multipart/MultipartHandler.java @@ -1,27 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [29 Oct 2013, 14:23:16 (GMT)] */ package thaumic.tinkerer.common.multipart; -import codechicken.microblock.BlockMicroMaterial; -import codechicken.microblock.MicroMaterialRegistry; import net.minecraft.block.Block; + import thaumcraft.common.config.ConfigBlocks; import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.quartz.BlockDarkQuartz; +import codechicken.microblock.BlockMicroMaterial; +import codechicken.microblock.MicroMaterialRegistry; public class MultipartHandler { + public MultipartHandler() { ThaumicTinkerer.log.trace("Loading Multipart Handler class"); registerMultipart(ConfigBlocks.blockCustomOre, 0); @@ -45,6 +44,7 @@ public class MultipartHandler { private static void registerMultipart(Block block, int meta) { MicroMaterialRegistry.registerMaterial( - new BlockMicroMaterial(block, meta), block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta)); + new BlockMicroMaterial(block, meta), + block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta)); } } diff --git a/src/main/java/thaumic/tinkerer/common/multipart/PartCandle.java b/src/main/java/thaumic/tinkerer/common/multipart/PartCandle.java index 8866f390..91f6d7b1 100644 --- a/src/main/java/thaumic/tinkerer/common/multipart/PartCandle.java +++ b/src/main/java/thaumic/tinkerer/common/multipart/PartCandle.java @@ -1,30 +1,25 @@ /* - * - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. - * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) - * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 - * (http://www.minecraftforum.net/topic/1585216-) - * - * File Created @ [25 Oct 2013, 17:26:07 (GMT)] + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. ThaumicTinkerer is Open + * Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License + * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) ThaumicTinkerer is a Derivative Work on Thaumcraft 4. + * Thaumcraft 4 (c) Azanor 2012 (http://www.minecraftforum.net/topic/1585216-) File Created @ [25 Oct 2013, 17:26:07 + * (GMT)] */ package thaumic.tinkerer.common.multipart; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +import thaumcraft.common.config.ConfigBlocks; import codechicken.lib.vec.Cuboid6; import codechicken.multipart.IRandomDisplayTick; import codechicken.multipart.minecraft.McMetaPart; -import java.util.Arrays; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import thaumcraft.common.config.ConfigBlocks; public class PartCandle extends McMetaPart implements IRandomDisplayTick { + public PartCandle(int meta) { super(meta); } diff --git a/src/main/java/thaumic/tinkerer/common/multipart/PartNitor.java b/src/main/java/thaumic/tinkerer/common/multipart/PartNitor.java index 5ccff2e8..ffc17088 100644 --- a/src/main/java/thaumic/tinkerer/common/multipart/PartNitor.java +++ b/src/main/java/thaumic/tinkerer/common/multipart/PartNitor.java @@ -1,26 +1,25 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [25 Oct 2013, 19:11:44 (GMT)] */ package thaumic.tinkerer.common.multipart; -import codechicken.lib.vec.Cuboid6; -import codechicken.multipart.minecraft.McMetaPart; import net.minecraft.block.Block; + import thaumcraft.common.config.ConfigBlocks; import thaumic.tinkerer.common.ThaumicTinkerer; +import codechicken.lib.vec.Cuboid6; +import codechicken.multipart.minecraft.McMetaPart; public class PartNitor extends McMetaPart { + public PartNitor() { super(1); } diff --git a/src/main/java/thaumic/tinkerer/common/multipart/RegisterBlockPart.java b/src/main/java/thaumic/tinkerer/common/multipart/RegisterBlockPart.java index 0d3167c8..cf5854ee 100644 --- a/src/main/java/thaumic/tinkerer/common/multipart/RegisterBlockPart.java +++ b/src/main/java/thaumic/tinkerer/common/multipart/RegisterBlockPart.java @@ -1,25 +1,26 @@ /** - * @author RWTema - * Thanks man! + * @author RWTema Thanks man! * - * Check out his mod, ExtraUtilities: - * http://www.minecraftforum.net/topic/1776056- + * Check out his mod, ExtraUtilities: http://www.minecraftforum.net/topic/1776056- */ package thaumic.tinkerer.common.multipart; +import net.minecraft.block.Block; +import net.minecraft.world.World; + import codechicken.lib.vec.BlockCoord; import codechicken.multipart.MultiPartRegistry; import codechicken.multipart.MultiPartRegistry.IPartConverter; import codechicken.multipart.MultiPartRegistry.IPartFactory; import codechicken.multipart.TMultiPart; + import com.google.common.collect.Lists; -import net.minecraft.block.Block; -import net.minecraft.world.World; // This class is used by FMP to recreate a part during loading and to convert already existing non-mutlipart blocks into // multiparts. // this is copied from the version FMP uses for vanilla torches public class RegisterBlockPart implements IPartFactory, IPartConverter { + Block block = null; Class part = null; String name = ""; @@ -41,13 +42,12 @@ public class RegisterBlockPart implements IPartFactory, IPartConverter { @Override public TMultiPart createPart(String name, boolean client) { - if (name.equals(name)) - try { - return part.getConstructor().newInstance(); - } catch (Exception e) { - e.printStackTrace(); - return null; - } + if (name.equals(name)) try { + return part.getConstructor().newInstance(); + } catch (Exception e) { + e.printStackTrace(); + return null; + } return null; } @@ -55,7 +55,7 @@ public class RegisterBlockPart implements IPartFactory, IPartConverter { public void init() { if (name.isEmpty() || block == null || part == null) return; MultiPartRegistry.registerConverter(this); - MultiPartRegistry.registerParts(this, new String[] {name}); + MultiPartRegistry.registerParts(this, new String[] { name }); } @Override diff --git a/src/main/java/thaumic/tinkerer/common/network/AbstractPacket.java b/src/main/java/thaumic/tinkerer/common/network/AbstractPacket.java index c3a39ebe..68bcadef 100644 --- a/src/main/java/thaumic/tinkerer/common/network/AbstractPacket.java +++ b/src/main/java/thaumic/tinkerer/common/network/AbstractPacket.java @@ -1,12 +1,14 @@ package thaumic.tinkerer.common.network; -import cpw.mods.fml.common.network.simpleimpl.IMessage; import net.minecraft.entity.player.EntityPlayer; +import cpw.mods.fml.common.network.simpleimpl.IMessage; + /** * Created by Katrina on 03/06/14. */ public abstract class AbstractPacket implements IMessage { + public abstract void handleClientSide(EntityPlayer entityPlayer); public abstract void handleServerSide(EntityPlayer entityPlayer); diff --git a/src/main/java/thaumic/tinkerer/common/network/GuiHandler.java b/src/main/java/thaumic/tinkerer/common/network/GuiHandler.java index 9b882d38..49fc1ee1 100644 --- a/src/main/java/thaumic/tinkerer/common/network/GuiHandler.java +++ b/src/main/java/thaumic/tinkerer/common/network/GuiHandler.java @@ -1,23 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 16:29:28 (GMT)] */ package thaumic.tinkerer.common.network; -import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumic.tinkerer.client.gui.*; import thaumic.tinkerer.client.gui.kami.GuiIchorPouch; import thaumic.tinkerer.client.gui.kami.GuiWarpGate; @@ -33,6 +30,7 @@ import thaumic.tinkerer.common.block.tile.kami.TileWarpGate; import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet; import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.lib.LibGuiIDs; +import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { diff --git a/src/main/java/thaumic/tinkerer/common/network/PlayerTracker.java b/src/main/java/thaumic/tinkerer/common/network/PlayerTracker.java index d6aaeced..67a9be8d 100644 --- a/src/main/java/thaumic/tinkerer/common/network/PlayerTracker.java +++ b/src/main/java/thaumic/tinkerer/common/network/PlayerTracker.java @@ -1,25 +1,19 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [25 Oct 2013, 21:25:50 (GMT)] */ package thaumic.tinkerer.common.network; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent; -import cpw.mods.fml.relauncher.Side; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.kami.KamiArmorHandler; import thaumic.tinkerer.common.item.foci.ItemFocusHeal; @@ -27,6 +21,10 @@ import thaumic.tinkerer.common.item.foci.ItemFocusSmelt; import thaumic.tinkerer.common.item.kami.armor.ItemGemBoots; import thaumic.tinkerer.common.item.kami.armor.ItemGemChest; import thaumic.tinkerer.common.network.packet.kami.PacketToggleArmor; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; +import cpw.mods.fml.relauncher.Side; public class PlayerTracker { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterAddEnchant.java b/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterAddEnchant.java index a19a604f..4af85a1c 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterAddEnchant.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterAddEnchant.java @@ -1,27 +1,25 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [16 Sep 2013, 15:45:54 (GMT)] */ package thaumic.tinkerer.common.network.packet; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.player.EntityPlayer; + +import thaumic.tinkerer.common.block.tile.TileEnchanter; +import thaumic.tinkerer.common.enchantment.core.EnchantmentManager; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import net.minecraft.enchantment.Enchantment; -import net.minecraft.entity.player.EntityPlayer; -import thaumic.tinkerer.common.block.tile.TileEnchanter; -import thaumic.tinkerer.common.enchantment.core.EnchantmentManager; public class PacketEnchanterAddEnchant extends PacketTile implements IMessageHandler { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterStartWorking.java b/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterStartWorking.java index 4154f06b..e99b808e 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterStartWorking.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/PacketEnchanterStartWorking.java @@ -1,23 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [16 Sep 2013, 21:49:24 (GMT)] */ package thaumic.tinkerer.common.network.packet; +import thaumic.tinkerer.common.block.tile.TileEnchanter; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import thaumic.tinkerer.common.block.tile.TileEnchanter; public class PacketEnchanterStartWorking extends PacketTile implements IMessageHandler { @@ -41,8 +38,7 @@ public class PacketEnchanterStartWorking extends PacketTile throw new IllegalStateException("received PacketEnchanterStartWorking " + message + "on client side!"); if (!message.tile.working && !message.tile.enchantments.isEmpty() && !message.tile.levels.isEmpty()) { message.tile.working = true; - message.tile - .getWorldObj() + message.tile.getWorldObj() .markBlockForUpdate(message.tile.xCoord, message.tile.yCoord, message.tile.zCoord); } return null; diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/PacketMobMagnetButton.java b/src/main/java/thaumic/tinkerer/common/network/packet/PacketMobMagnetButton.java index 87d32021..bf0587ca 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/PacketMobMagnetButton.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/PacketMobMagnetButton.java @@ -1,24 +1,21 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [12 Sep 2013, 18:44:52 (GMT)] */ package thaumic.tinkerer.common.network.packet; +import thaumic.tinkerer.common.block.tile.TileMobMagnet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import thaumic.tinkerer.common.block.tile.TileMobMagnet; public class PacketMobMagnetButton extends PacketTile implements IMessageHandler { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/PacketPlacerButton.java b/src/main/java/thaumic/tinkerer/common/network/packet/PacketPlacerButton.java index db86ceb8..bb99429b 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/PacketPlacerButton.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/PacketPlacerButton.java @@ -1,10 +1,10 @@ package thaumic.tinkerer.common.network.packet; +import thaumic.tinkerer.common.block.tile.TileRPlacer; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import thaumic.tinkerer.common.block.tile.TileRPlacer; /** * Created by nekosune on 30/06/14. diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/PacketTabletButton.java b/src/main/java/thaumic/tinkerer/common/network/packet/PacketTabletButton.java index c98f7be8..6b28ccb8 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/PacketTabletButton.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/PacketTabletButton.java @@ -1,24 +1,21 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 17:02:18 (GMT)] */ package thaumic.tinkerer.common.network.packet; +import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import thaumic.tinkerer.common.block.tile.tablet.TileAnimationTablet; public class PacketTabletButton extends PacketTile implements IMessageHandler { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/PacketTile.java b/src/main/java/thaumic/tinkerer/common/network/packet/PacketTile.java index aeaa7bcc..4098203a 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/PacketTile.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/PacketTile.java @@ -1,28 +1,26 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [9 Sep 2013, 17:00:10 (GMT)] */ package thaumic.tinkerer.common.network.packet; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumic.tinkerer.client.core.proxy.TTClientProxy; import thaumic.tinkerer.common.core.helper.MiscHelper; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import io.netty.buffer.ByteBuf; public abstract class PacketTile implements IMessage { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketSoulHearts.java b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketSoulHearts.java index 9c437c08..89f1ee95 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketSoulHearts.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketSoulHearts.java @@ -1,24 +1,21 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 29, 2013, 9:41:05 PM (GMT)] */ package thaumic.tinkerer.common.network.packet.kami; +import thaumic.tinkerer.client.core.handler.kami.SoulHeartClientHandler; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import thaumic.tinkerer.client.core.handler.kami.SoulHeartClientHandler; public class PacketSoulHearts implements IMessage, IMessageHandler { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketToggleArmor.java b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketToggleArmor.java index 4e17070c..d2b37037 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketToggleArmor.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketToggleArmor.java @@ -1,17 +1,19 @@ package thaumic.tinkerer.common.network.packet.kami; +import net.minecraft.entity.player.EntityPlayer; + +import thaumic.tinkerer.client.core.proxy.TTClientProxy; +import thaumic.tinkerer.common.ThaumicTinkerer; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import thaumic.tinkerer.client.core.proxy.TTClientProxy; -import thaumic.tinkerer.common.ThaumicTinkerer; /** * Created by Katrina on 28/02/14. */ public class PacketToggleArmor implements IMessage, IMessageHandler { + private static final long serialVersionUID = -1247633508013055777L; public boolean armorStatus; diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateButton.java b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateButton.java index c916493c..6ec320c4 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateButton.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateButton.java @@ -1,25 +1,22 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 5:59:27 PM (GMT)] */ package thaumic.tinkerer.common.network.packet.kami; +import thaumic.tinkerer.common.block.tile.kami.TileWarpGate; +import thaumic.tinkerer.common.network.packet.PacketTile; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import thaumic.tinkerer.common.block.tile.kami.TileWarpGate; -import thaumic.tinkerer.common.network.packet.PacketTile; public class PacketWarpGateButton extends PacketTile implements IMessageHandler { diff --git a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateTeleport.java b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateTeleport.java index 55ee0658..48590350 100644 --- a/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateTeleport.java +++ b/src/main/java/thaumic/tinkerer/common/network/packet/kami/PacketWarpGateTeleport.java @@ -1,26 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Jan 10, 2014, 7:21:05 PM (GMT)] */ package thaumic.tinkerer.common.network.packet.kami; +import net.minecraft.entity.player.EntityPlayer; + +import thaumic.tinkerer.common.block.tile.kami.TileWarpGate; +import thaumic.tinkerer.common.network.packet.PacketTile; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import thaumic.tinkerer.common.block.tile.kami.TileWarpGate; -import thaumic.tinkerer.common.network.packet.PacketTile; public class PacketWarpGateTeleport extends PacketTile implements IMessageHandler { diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneBore.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneBore.java index 0c39e74d..6de3f2d6 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneBore.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneBore.java @@ -5,10 +5,12 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.ManagedEnvironment; import li.cil.oc.api.prefab.DriverTileEntity; + import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.common.items.equipment.ItemElementalPickaxe; import thaumcraft.common.tiles.TileArcaneBore; @@ -16,6 +18,7 @@ import thaumcraft.common.tiles.TileArcaneBore; * Created by Katrina on 22/04/14. */ public class DriverArcaneBore extends DriverTileEntity { + @Override public Class getTileEntityClass() { return TileArcaneBore.class; @@ -34,60 +37,57 @@ public class DriverArcaneBore extends DriverTileEntity { @Callback(doc = "function():boolean -- does the bore have a pickaxe") public Object[] hasPickaxe(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.hasPickaxe}; + return new Object[] { this.tileEntity.hasPickaxe }; } @Callback(doc = "function():boolean -- does the bore have a focus") public Object[] hasFocus(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.hasFocus}; + return new Object[] { this.tileEntity.hasFocus }; } @Callback(doc = "function():boolean -- is the pickaxe near broken?") public Object[] isPickaxeBroken(final Context context, final Arguments arguments) { ItemStack pickaxe = tileEntity.getStackInSlot(1); boolean nearBroken = pickaxe != null && pickaxe.getItemDamage() + 1 == pickaxe.getMaxDamage(); - return new Object[] {nearBroken}; + return new Object[] { nearBroken }; } @Callback(doc = "function():boolean -- Is the bore working?") public Object[] isWorking(final Context context, final Arguments arguments) { ItemStack pickaxe = tileEntity.getStackInSlot(1); boolean nearBroken = pickaxe != null && pickaxe.getItemDamage() + 1 == pickaxe.getMaxDamage(); - return new Object[] { - this.tileEntity.gettingPower() - && this.tileEntity.hasFocus - && this.tileEntity.hasPickaxe - && pickaxe.isItemStackDamageable() - && !nearBroken - }; + return new Object[] { this.tileEntity.gettingPower() && this.tileEntity.hasFocus + && this.tileEntity.hasPickaxe + && pickaxe.isItemStackDamageable() + && !nearBroken }; } @Callback(doc = "function():number -- Gets bore's radius") public Object[] getRadius(final Context context, final Arguments arguments) { - return new Object[] {1 + (tileEntity.area + tileEntity.maxRadius) * 2}; + return new Object[] { 1 + (tileEntity.area + tileEntity.maxRadius) * 2 }; } @Callback(doc = "function():number -- Gets bore's speed") public Object[] getSpeed(final Context context, final Arguments arguments) { - return new Object[] {tileEntity.speed}; + return new Object[] { tileEntity.speed }; } @Callback(doc = "function():boolean -- Will the bore get native clusters?") public Object[] hasNativeClusters(final Context context, final Arguments arguments) { ItemStack pickaxe = tileEntity.getStackInSlot(1); - return new Object[] {pickaxe != null && pickaxe.getItem() instanceof ItemElementalPickaxe}; + return new Object[] { pickaxe != null && pickaxe.getItem() instanceof ItemElementalPickaxe }; } @Callback(doc = "function():number -- What level fortune on pick") public Object[] getFortune(final Context context, final Arguments arguments) { ItemStack pickaxe = tileEntity.getStackInSlot(1); - return new Object[] {EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, pickaxe)}; + return new Object[] { EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, pickaxe) }; } @Callback(doc = "function():boolean -- Does the pick have silk touch?") public Object[] hasSilkTouch(final Context context, final Arguments arguments) { ItemStack pickaxe = tileEntity.getStackInSlot(1); - return new Object[] {EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, pickaxe) > 0}; + return new Object[] { EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, pickaxe) > 0 }; } } } diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneEar.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneEar.java index 80e53bf7..00df074a 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneEar.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverArcaneEar.java @@ -5,7 +5,9 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.ManagedEnvironment; import li.cil.oc.api.prefab.DriverTileEntity; + import net.minecraft.world.World; + import thaumcraft.common.tiles.TileSensor; import thaumic.tinkerer.common.peripheral.implementation.ArcaneEarImplementation; @@ -13,6 +15,7 @@ import thaumic.tinkerer.common.peripheral.implementation.ArcaneEarImplementation * Created by Katrina on 21/04/14. */ public class DriverArcaneEar extends DriverTileEntity { + @Override public Class getTileEntityClass() { return TileSensor.class; diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverBrainInAJar.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverBrainInAJar.java index 7f399dc6..d8c8d544 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverBrainInAJar.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverBrainInAJar.java @@ -5,13 +5,16 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.ManagedEnvironment; import li.cil.oc.api.prefab.DriverTileEntity; + import net.minecraft.world.World; + import thaumcraft.common.tiles.TileJarBrain; /** * Created by Katrina on 22/04/14. */ public class DriverBrainInAJar extends DriverTileEntity { + @Override public Class getTileEntityClass() { return TileJarBrain.class; @@ -30,7 +33,7 @@ public class DriverBrainInAJar extends DriverTileEntity { @Callback(doc = "function():number -- returns the amount of XP in this jar") public Object[] getXP(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.xp}; + return new Object[] { this.tileEntity.xp }; } } } diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverDeconstructor.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverDeconstructor.java index 9cd29059..f629d71e 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverDeconstructor.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverDeconstructor.java @@ -5,13 +5,16 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.ManagedEnvironment; import li.cil.oc.api.prefab.DriverTileEntity; + import net.minecraft.world.World; + import thaumcraft.common.tiles.TileDeconstructionTable; /** * Created by Katrina on 22/04/14. */ public class DriverDeconstructor extends DriverTileEntity { + @Override public Class getTileEntityClass() { return TileDeconstructionTable.class; @@ -30,17 +33,17 @@ public class DriverDeconstructor extends DriverTileEntity { @Callback(doc = "function():boolean -- returns if the table has an aspect waiting") public Object[] hasAspect(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.aspect != null}; + return new Object[] { this.tileEntity.aspect != null }; } @Callback(doc = "function():boolean -- returns if the table has an item in the slot") public Object[] hasItem(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.getStackInSlot(0) != null}; + return new Object[] { this.tileEntity.getStackInSlot(0) != null }; } @Callback(doc = "function():string -- returns aspect in the deconstructor") public Object[] getAspect(final Context context, final Arguments arguments) { - return this.tileEntity.aspect != null ? new Object[] {tileEntity.aspect.getTag()} : null; + return this.tileEntity.aspect != null ? new Object[] { tileEntity.aspect.getTag() } : null; } } } diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverEssentiaTransport.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverEssentiaTransport.java index 0bc953dd..4c75aa3b 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverEssentiaTransport.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverEssentiaTransport.java @@ -5,8 +5,10 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.ManagedEnvironment; import li.cil.oc.api.prefab.DriverTileEntity; + import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.IEssentiaTransport; @@ -14,6 +16,7 @@ import thaumcraft.api.aspects.IEssentiaTransport; * Created by Katrina on 22/04/14. */ public class DriverEssentiaTransport extends DriverTileEntity { + @Override public Class getTileEntityClass() { return IEssentiaTransport.class; @@ -32,54 +35,50 @@ public class DriverEssentiaTransport extends DriverTileEntity { @Callback(doc = "function(direction:number):boolean -- returns is the pipe connectable from this direction") public Object[] isConnectable(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.isConnectable(ForgeDirection.getOrientation(arguments.checkInteger(0))) - }; + return new Object[] { + this.tileEntity.isConnectable(ForgeDirection.getOrientation(arguments.checkInteger(0))) }; } @Callback(doc = "function(direction:number):boolean -- can pipe input from direction") public Object[] canInputFrom(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.canInputFrom(ForgeDirection.getOrientation(arguments.checkInteger(0))) - }; + return new Object[] { + this.tileEntity.canInputFrom(ForgeDirection.getOrientation(arguments.checkInteger(0))) }; } @Callback(doc = "function(direction:number):boolean -- can pipe output to direction") public Object[] canOutputTo(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.canOutputTo(ForgeDirection.getOrientation(arguments.checkInteger(0)))}; + return new Object[] { + this.tileEntity.canOutputTo(ForgeDirection.getOrientation(arguments.checkInteger(0))) }; } @Callback(doc = "function(direction:number):string -- returns which aspect suction") public Object[] getSuctionType(final Context context, final Arguments arguments) { return new Object[] { - this.tileEntity - .getSuctionType(ForgeDirection.getOrientation(arguments.checkInteger(0))) - .getTag() - }; + this.tileEntity.getSuctionType(ForgeDirection.getOrientation(arguments.checkInteger(0))).getTag() }; } @Callback(doc = "function(direction:number):number -- returnd amount of suction") public Object[] getSuctionAmount(final Context context, final Arguments arguments) { return new Object[] { - this.tileEntity.getSuctionAmount(ForgeDirection.getOrientation(arguments.checkInteger(0))) - }; + this.tileEntity.getSuctionAmount(ForgeDirection.getOrientation(arguments.checkInteger(0))) }; } @Callback(doc = "function(direction:number):string -- returns which essentia in pipe") public Object[] getEssentiaType(final Context context, final Arguments arguments) { Aspect aspect = this.tileEntity.getEssentiaType(ForgeDirection.getOrientation(arguments.checkInteger(0))); if (aspect == null) return new Object[] {}; - return new Object[] {aspect.getTag()}; + return new Object[] { aspect.getTag() }; } @Callback(doc = "function(direction:number):number -- returnd amount of essentia") public Object[] getEssentiaAmount(final Context context, final Arguments arguments) { return new Object[] { - this.tileEntity.getEssentiaAmount(ForgeDirection.getOrientation(arguments.checkInteger(0))) - }; + this.tileEntity.getEssentiaAmount(ForgeDirection.getOrientation(arguments.checkInteger(0))) }; } @Callback(doc = "function():number -- returns minimum suction") public Object[] getMinimumSuction(final Context context, final Arguments arguments) { - return new Object[] {this.tileEntity.getMinimumSuction()}; + return new Object[] { this.tileEntity.getMinimumSuction() }; } } } diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverIAspectContainer.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverIAspectContainer.java index d744aa97..4e9ed30d 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverIAspectContainer.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/DriverIAspectContainer.java @@ -5,7 +5,9 @@ import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; import li.cil.oc.api.network.ManagedEnvironment; import li.cil.oc.api.prefab.DriverTileEntity; + import net.minecraft.world.World; + import thaumcraft.api.aspects.IAspectContainer; import thaumic.tinkerer.common.peripheral.implementation.IAspectContainerImplementation; @@ -13,6 +15,7 @@ import thaumic.tinkerer.common.peripheral.implementation.IAspectContainerImpleme * Created by Katrina on 27/03/14. */ public class DriverIAspectContainer extends DriverTileEntity { + @Override public Class getTileEntityClass() { return IAspectContainer.class; diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/ManagedTileEntityEnvironment.java b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/ManagedTileEntityEnvironment.java index 5b6bbb29..2621211d 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/ManagedTileEntityEnvironment.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/OpenComputers/ManagedTileEntityEnvironment.java @@ -5,6 +5,7 @@ import li.cil.oc.api.network.Visibility; import li.cil.oc.api.prefab.ManagedEnvironment; public class ManagedTileEntityEnvironment extends ManagedEnvironment { + protected final T tileEntity; public ManagedTileEntityEnvironment(final T tileEntity, final String name) { diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneBore.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneBore.java index e163f32a..950fe088 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneBore.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneBore.java @@ -1,27 +1,25 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 10:03:09 PM (GMT)] */ package thaumic.tinkerer.common.peripheral; -import dan200.computercraft.api.lua.ILuaContext; -import dan200.computercraft.api.peripheral.IComputerAccess; -import dan200.computercraft.api.peripheral.IPeripheral; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.ItemStack; + import thaumcraft.common.items.equipment.ItemElementalPickaxe; import thaumcraft.common.tiles.TileArcaneBore; +import dan200.computercraft.api.lua.ILuaContext; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; public class PeripheralArcaneBore implements IPeripheral { @@ -38,17 +36,8 @@ public class PeripheralArcaneBore implements IPeripheral { @Override public String[] getMethodNames() { - return new String[] { - "hasPickaxe", - "hasFocus", - "isPickaxeBroken", - "isWorking", - "getRadius", - "getSpeed", - "hasNativeClusters", - "getFortune", - "hasSilkTouch" - }; + return new String[] { "hasPickaxe", "hasFocus", "isPickaxeBroken", "isWorking", "getRadius", "getSpeed", + "hasNativeClusters", "getFortune", "hasSilkTouch" }; } @Override @@ -58,30 +47,27 @@ public class PeripheralArcaneBore implements IPeripheral { switch (method) { case 0: - return new Object[] {bore.hasPickaxe}; + return new Object[] { bore.hasPickaxe }; case 1: - return new Object[] {bore.hasFocus}; + return new Object[] { bore.hasFocus }; case 2: - return new Object[] {nearBroken}; - case 3: //noinspection ConstantConditions - return new Object[] { - bore.gettingPower() - && bore.hasFocus - && bore.hasPickaxe - && pickaxe.isItemStackDamageable() - && !nearBroken - }; + return new Object[] { nearBroken }; + case 3: // noinspection ConstantConditions + return new Object[] { bore.gettingPower() && bore.hasFocus + && bore.hasPickaxe + && pickaxe.isItemStackDamageable() + && !nearBroken }; case 4: - return new Object[] {1 + (bore.area + bore.maxRadius) * 2}; + return new Object[] { 1 + (bore.area + bore.maxRadius) * 2 }; case 5: - return new Object[] {bore.speed}; + return new Object[] { bore.speed }; case 6: - return new Object[] {pickaxe != null && pickaxe.getItem() instanceof ItemElementalPickaxe}; + return new Object[] { pickaxe != null && pickaxe.getItem() instanceof ItemElementalPickaxe }; case 7: - return new Object[] {EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, pickaxe)}; + return new Object[] { EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, pickaxe) }; case 8: - return new Object[] {EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, pickaxe) > 0 - }; + return new Object[] { + EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, pickaxe) > 0 }; } return null; diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneEar.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneEar.java index 74f425c2..9f94b28a 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneEar.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralArcaneEar.java @@ -1,23 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 9:41:49 PM (GMT)] */ package thaumic.tinkerer.common.peripheral; +import thaumcraft.common.tiles.TileSensor; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import thaumcraft.common.tiles.TileSensor; public class PeripheralArcaneEar implements IPeripheral { @@ -34,13 +31,13 @@ public class PeripheralArcaneEar implements IPeripheral { @Override public String[] getMethodNames() { - return new String[] {"getNote", "setNote"}; + return new String[] { "getNote", "setNote" }; } @Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { if (method == 0) { - return new Object[] {ear.note}; + return new Object[] { ear.note }; } else { ear.note = (byte) ((Double) arguments[0]).doubleValue(); diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralAspectContainer.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralAspectContainer.java index 2cfced14..073b2338 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralAspectContainer.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralAspectContainer.java @@ -1,25 +1,22 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [13 Sep 2013, 00:58:21 (GMT)] */ package thaumic.tinkerer.common.peripheral; +import thaumcraft.api.aspects.IAspectContainer; +import thaumic.tinkerer.common.peripheral.implementation.IAspectContainerImplementation; import cpw.mods.fml.common.Optional; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import thaumcraft.api.aspects.IAspectContainer; -import thaumic.tinkerer.common.peripheral.implementation.IAspectContainerImplementation; public class PeripheralAspectContainer implements IPeripheral { @@ -36,7 +33,7 @@ public class PeripheralAspectContainer implements IPeripheral { @Override public String[] getMethodNames() { - return new String[] {"getAspects", "getAspectCount"}; + return new String[] { "getAspects", "getAspectCount" }; } @Override diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralBrainInAJar.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralBrainInAJar.java index 2c198d68..620bee49 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralBrainInAJar.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralBrainInAJar.java @@ -1,23 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 9:36:45 PM (GMT)] */ package thaumic.tinkerer.common.peripheral; +import thaumcraft.common.tiles.TileJarBrain; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import thaumcraft.common.tiles.TileJarBrain; public class PeripheralBrainInAJar implements IPeripheral { @@ -34,12 +31,12 @@ public class PeripheralBrainInAJar implements IPeripheral { @Override public String[] getMethodNames() { - return new String[] {"getXP"}; + return new String[] { "getXP" }; } @Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { - return new Object[] {jar.xp}; + return new Object[] { jar.xp }; } @Override diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralDeconstructor.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralDeconstructor.java index 3c6cd958..152e48d7 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralDeconstructor.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralDeconstructor.java @@ -1,23 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [13 Sep 2013, 01:10:52 (GMT)] */ package thaumic.tinkerer.common.peripheral; +import thaumcraft.common.tiles.TileDeconstructionTable; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import thaumcraft.common.tiles.TileDeconstructionTable; public class PeripheralDeconstructor implements IPeripheral { @@ -34,18 +31,18 @@ public class PeripheralDeconstructor implements IPeripheral { @Override public String[] getMethodNames() { - return new String[] {"hasAspect", "hasItem", "getAspect"}; + return new String[] { "hasAspect", "hasItem", "getAspect" }; } @Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) { switch (method) { case 0: - return new Object[] {deconstructor.aspect != null}; + return new Object[] { deconstructor.aspect != null }; case 1: - return new Object[] {deconstructor.getStackInSlot(0) != null}; + return new Object[] { deconstructor.getStackInSlot(0) != null }; case 2: - return deconstructor.aspect == null ? null : new Object[] {deconstructor.aspect.getTag()}; + return deconstructor.aspect == null ? null : new Object[] { deconstructor.aspect.getTag() }; } return null; diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralEssentiaTransport.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralEssentiaTransport.java index a9f74b51..8ec6b077 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralEssentiaTransport.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralEssentiaTransport.java @@ -1,11 +1,12 @@ package thaumic.tinkerer.common.peripheral; +import net.minecraftforge.common.util.ForgeDirection; + +import thaumcraft.api.aspects.IEssentiaTransport; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; -import net.minecraftforge.common.util.ForgeDirection; -import thaumcraft.api.aspects.IEssentiaTransport; /** * Created by Katrina on 03/03/14. @@ -30,16 +31,8 @@ public class PeripheralEssentiaTransport implements IPeripheral { @Override public String[] getMethodNames() { - return new String[] { - "isConnectable", - "canInputFrom", - "canOutputTo", - "getSuctionType", - "getSuctionAmount", - "getEssentiaType", - "getEssentiaAmount", - "getMinimumSuction" - }; + return new String[] { "isConnectable", "canInputFrom", "canOutputTo", "getSuctionType", "getSuctionAmount", + "getEssentiaType", "getEssentiaAmount", "getMinimumSuction" }; } @Override @@ -47,27 +40,25 @@ public class PeripheralEssentiaTransport implements IPeripheral { throws LuaException { switch (method) { case 0: - return new Object[] {pipe.isConnectable(ForgeDirection.getOrientation(GetDirection(arguments[0])))}; + return new Object[] { pipe.isConnectable(ForgeDirection.getOrientation(GetDirection(arguments[0]))) }; case 1: - return new Object[] {pipe.canInputFrom(ForgeDirection.getOrientation(GetDirection(arguments[0])))}; + return new Object[] { pipe.canInputFrom(ForgeDirection.getOrientation(GetDirection(arguments[0]))) }; case 2: - return new Object[] {pipe.canOutputTo(ForgeDirection.getOrientation(GetDirection(arguments[0])))}; + return new Object[] { pipe.canOutputTo(ForgeDirection.getOrientation(GetDirection(arguments[0]))) }; case 3: return new Object[] { - pipe.getSuctionType(ForgeDirection.getOrientation(GetDirection(arguments[0]))) - .getTag() - }; + pipe.getSuctionType(ForgeDirection.getOrientation(GetDirection(arguments[0]))).getTag() }; case 4: - return new Object[] {pipe.getSuctionAmount(ForgeDirection.getOrientation(GetDirection(arguments[0])))}; + return new Object[] { + pipe.getSuctionAmount(ForgeDirection.getOrientation(GetDirection(arguments[0]))) }; case 5: return new Object[] { - pipe.getEssentiaType(ForgeDirection.getOrientation(GetDirection(arguments[0]))) - .getTag() - }; + pipe.getEssentiaType(ForgeDirection.getOrientation(GetDirection(arguments[0]))).getTag() }; case 6: - return new Object[] {pipe.getEssentiaAmount(ForgeDirection.getOrientation(GetDirection(arguments[0])))}; + return new Object[] { + pipe.getEssentiaAmount(ForgeDirection.getOrientation(GetDirection(arguments[0]))) }; case 7: - return new Object[] {pipe.getMinimumSuction()}; + return new Object[] { pipe.getMinimumSuction() }; } return new Object[0]; } diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralHandler.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralHandler.java index 3ac61eba..38f88b53 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralHandler.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralHandler.java @@ -1,32 +1,31 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [13 Sep 2013, 00:56:19 (GMT)] */ package thaumic.tinkerer.common.peripheral; -import dan200.computercraft.api.ComputerCraftAPI; -import dan200.computercraft.api.peripheral.IPeripheral; -import dan200.computercraft.api.peripheral.IPeripheralProvider; import java.util.ArrayList; import java.util.List; + import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.aspects.IEssentiaTransport; import thaumcraft.common.tiles.TileArcaneBore; import thaumcraft.common.tiles.TileDeconstructionTable; import thaumcraft.common.tiles.TileJarBrain; import thaumcraft.common.tiles.TileSensor; +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.peripheral.IPeripheralProvider; public final class PeripheralHandler implements IPeripheralProvider { diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralTransvectorInterface.java b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralTransvectorInterface.java index 4deb89eb..81f0bf68 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralTransvectorInterface.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/PeripheralTransvectorInterface.java @@ -1,71 +1,33 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 11, 2013, 9:49:46 PM (GMT)] *//* - - package thaumic.tinkerer.common.peripheral; - - import IEnergySink; - - import api.energy.IEnergyHandler; - import buildcraft.api.power.IPowerReceptor; - import net.minecraft.inventory.IInventory; - import net.minecraft.inventory.ISidedInventory; - import net.minecraft.tileentity.TileEntity; - import net.minecraftforge.fluids.IFluidHandler; - import thaumcraft.api.aspects.IAspectContainer; - import thaumcraft.api.aspects.IEssentiaTransport; - import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface; - import IComputerAccess; - import ILuaContext; - - public class PeripheralTransvectorInterface extends PeripheralAspectContainer { - - TileTransvectorInterface interfase; - - public PeripheralTransvectorInterface(TileTransvectorInterface interfase) { - super(interfase); - this.interfase = interfase; - } - - @Override - public String getType() { - return "tt_transvectorinterface"; - } - - @Override - public String[] getMethodNames() { - return new String[] { "getAspects", "getAspectCount", "isBound", "isInventory", "isSidedInventory", "isFluidContainer", "isMJHandler", "isEUHandler", "isRFHandler", "isAspectContainer", "isAspectTransport" }; - } - - @Override - public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws Exception { - TileEntity tile = interfase.getTile(); - - switch(method) { - case 2 : return new Object[] { tile != null }; - case 3 : return new Object[] { tile instanceof IInventory }; - case 4 : return new Object[] { tile instanceof ISidedInventory }; - case 5 : return new Object[] { tile instanceof IFluidHandler }; - case 6 : return new Object[] { tile instanceof IPowerReceptor }; - case 7 : return new Object[] { tile instanceof IEnergySink }; - case 8 : return new Object[] { tile instanceof IEnergyHandler }; - case 9 : return new Object[] { tile instanceof IAspectContainer }; - case 10 : return new Object[] { tile instanceof IEssentiaTransport }; - } - - return super.callMethod(computer, context, method, arguments); - } - - } - */ + * package thaumic.tinkerer.common.peripheral; import IEnergySink; import api.energy.IEnergyHandler; import + * buildcraft.api.power.IPowerReceptor; import net.minecraft.inventory.IInventory; import + * net.minecraft.inventory.ISidedInventory; import net.minecraft.tileentity.TileEntity; import + * net.minecraftforge.fluids.IFluidHandler; import thaumcraft.api.aspects.IAspectContainer; import + * thaumcraft.api.aspects.IEssentiaTransport; import + * thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface; import IComputerAccess; import + * ILuaContext; public class PeripheralTransvectorInterface extends PeripheralAspectContainer { + * TileTransvectorInterface interfase; public PeripheralTransvectorInterface(TileTransvectorInterface interfase) { + * super(interfase); this.interfase = interfase; } + * @Override public String getType() { return "tt_transvectorinterface"; } + * @Override public String[] getMethodNames() { return new String[] { "getAspects", "getAspectCount", "isBound", + * "isInventory", "isSidedInventory", "isFluidContainer", "isMJHandler", "isEUHandler", "isRFHandler", + * "isAspectContainer", "isAspectTransport" }; } + * @Override public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] + * arguments) throws Exception { TileEntity tile = interfase.getTile(); switch(method) { case 2 : return new Object[] + * { tile != null }; case 3 : return new Object[] { tile instanceof IInventory }; case 4 : return new Object[] { tile + * instanceof ISidedInventory }; case 5 : return new Object[] { tile instanceof IFluidHandler }; case 6 : return new + * Object[] { tile instanceof IPowerReceptor }; case 7 : return new Object[] { tile instanceof IEnergySink }; case 8 + * : return new Object[] { tile instanceof IEnergyHandler }; case 9 : return new Object[] { tile instanceof + * IAspectContainer }; case 10 : return new Object[] { tile instanceof IEssentiaTransport }; } return + * super.callMethod(computer, context, method, arguments); } } + */ diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/implementation/ArcaneEarImplementation.java b/src/main/java/thaumic/tinkerer/common/peripheral/implementation/ArcaneEarImplementation.java index a3ca459e..2f463b60 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/implementation/ArcaneEarImplementation.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/implementation/ArcaneEarImplementation.java @@ -8,7 +8,7 @@ import thaumcraft.common.tiles.TileSensor; public class ArcaneEarImplementation { public static Object[] getNote(TileSensor ear) { - return new Double[] {(double) ear.note}; + return new Double[] { (double) ear.note }; } public static Object[] setNote(TileSensor ear, byte note) { diff --git a/src/main/java/thaumic/tinkerer/common/peripheral/implementation/IAspectContainerImplementation.java b/src/main/java/thaumic/tinkerer/common/peripheral/implementation/IAspectContainerImplementation.java index 1e2733af..f79ee065 100644 --- a/src/main/java/thaumic/tinkerer/common/peripheral/implementation/IAspectContainerImplementation.java +++ b/src/main/java/thaumic/tinkerer/common/peripheral/implementation/IAspectContainerImplementation.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.peripheral.implementation; import java.util.HashMap; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.common.tiles.TileJarFillable; @@ -9,26 +10,27 @@ import thaumcraft.common.tiles.TileJarFillable; * Created by Katrina on 27/03/14. */ public class IAspectContainerImplementation { + public static Object[] getAspects(IAspectContainer container) { HashMap returnStuff = new HashMap(); double i = 1; if (container instanceof TileJarFillable && ((TileJarFillable) container).aspectFilter != null) { returnStuff.put(i++, ((TileJarFillable) container).aspectFilter.getTag()); - return new Object[] {returnStuff}; + return new Object[] { returnStuff }; } - if (container.getAspects() == null || container.getAspects().size() == 0) return new Object[] {returnStuff}; + if (container.getAspects() == null || container.getAspects().size() == 0) return new Object[] { returnStuff }; for (Aspect aspect : container.getAspects().getAspectsSorted()) returnStuff.put(i++, aspect.getTag()); - return new Object[] {returnStuff}; + return new Object[] { returnStuff }; } public static Object[] getAspectCount(IAspectContainer container, String aspectName) { Aspect aspect = Aspect.getAspect(aspectName); - if (container.getAspects() == null) return new Object[] {0}; + if (container.getAspects() == null) return new Object[] { 0 }; - return new Object[] {container.getAspects().getAmount(aspect)}; + return new Object[] { container.getAspects().getAmount(aspect) }; } } diff --git a/src/main/java/thaumic/tinkerer/common/potion/DummyPotions.java b/src/main/java/thaumic/tinkerer/common/potion/DummyPotions.java index a9221102..5653d78c 100644 --- a/src/main/java/thaumic/tinkerer/common/potion/DummyPotions.java +++ b/src/main/java/thaumic/tinkerer/common/potion/DummyPotions.java @@ -6,6 +6,7 @@ import net.minecraft.potion.Potion; * Created by pixlepix on 4/19/14. */ public class DummyPotions extends Potion { + public DummyPotions(int par1, boolean par2, int par3) { super(par1, par2, par3); } diff --git a/src/main/java/thaumic/tinkerer/common/potion/ModPotions.java b/src/main/java/thaumic/tinkerer/common/potion/ModPotions.java index b8f07be6..93750931 100644 --- a/src/main/java/thaumic/tinkerer/common/potion/ModPotions.java +++ b/src/main/java/thaumic/tinkerer/common/potion/ModPotions.java @@ -1,25 +1,24 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 16:59:57 (GMT)] */ package thaumic.tinkerer.common.potion; -import cpw.mods.fml.common.FMLCommonHandler; import java.lang.reflect.Field; import java.lang.reflect.Modifier; + import net.minecraft.potion.Potion; import net.minecraftforge.common.MinecraftForge; + import thaumic.tinkerer.common.core.handler.ConfigHandler; +import cpw.mods.fml.common.FMLCommonHandler; public final class ModPotions { @@ -55,17 +54,13 @@ public final class ModPotions { } } - potionFire = (new DummyPotions(ConfigHandler.potionFireId, true, 0)) - .setIconIndex(0, 0) + potionFire = (new DummyPotions(ConfigHandler.potionFireId, true, 0)).setIconIndex(0, 0) .setPotionName("Fire Imbued"); - potionWater = (new DummyPotions(ConfigHandler.potionWaterId, true, 0)) - .setIconIndex(0, 0) + potionWater = (new DummyPotions(ConfigHandler.potionWaterId, true, 0)).setIconIndex(0, 0) .setPotionName("Water Imbued"); - potionEarth = (new DummyPotions(ConfigHandler.potionEarthId, true, 0)) - .setIconIndex(0, 0) + potionEarth = (new DummyPotions(ConfigHandler.potionEarthId, true, 0)).setIconIndex(0, 0) .setPotionName("Earth Imbued"); - potionAir = (new DummyPotions(ConfigHandler.potionAirId, true, 0)) - .setIconIndex(0, 0) + potionAir = (new DummyPotions(ConfigHandler.potionAirId, true, 0)).setIconIndex(0, 0) .setPotionName("Air Imbued"); } } diff --git a/src/main/java/thaumic/tinkerer/common/potion/PotionEffectHandler.java b/src/main/java/thaumic/tinkerer/common/potion/PotionEffectHandler.java index 0fbc14e7..ff094da7 100644 --- a/src/main/java/thaumic/tinkerer/common/potion/PotionEffectHandler.java +++ b/src/main/java/thaumic/tinkerer/common/potion/PotionEffectHandler.java @@ -1,16 +1,18 @@ package thaumic.tinkerer.common.potion; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; import java.util.HashMap; import java.util.Iterator; import java.util.Random; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraftforge.event.entity.living.LivingAttackEvent; + import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.BlockForcefield; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; /** * Created by pixlepix on 4/19/14. @@ -46,8 +48,8 @@ public class PotionEffectHandler { centerY + i, centerZ + j, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockForcefield.class)); - ThaumicTinkerer.tcProxy.blockSparkle( - p.worldObj, centerX, centerY + i, centerZ + j, 100, 100); + ThaumicTinkerer.tcProxy + .blockSparkle(p.worldObj, centerX, centerY + i, centerZ + j, 100, 100); } } else { if (p.worldObj.isAirBlock(centerX + j, centerY + i, centerZ)) { @@ -57,8 +59,8 @@ public class PotionEffectHandler { centerZ, ThaumicTinkerer.registry.getFirstBlockFromClass(BlockForcefield.class)); - ThaumicTinkerer.tcProxy.blockSparkle( - p.worldObj, centerX + j, centerY + i, centerZ, 100, 100); + ThaumicTinkerer.tcProxy + .blockSparkle(p.worldObj, centerX + j, centerY + i, centerZ, 100, 100); } } } diff --git a/src/main/java/thaumic/tinkerer/common/registry/IMultiTileEntityBlock.java b/src/main/java/thaumic/tinkerer/common/registry/IMultiTileEntityBlock.java index 3ab54835..fa7ce012 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/IMultiTileEntityBlock.java +++ b/src/main/java/thaumic/tinkerer/common/registry/IMultiTileEntityBlock.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.registry; import java.util.HashMap; + import net.minecraft.tileentity.TileEntity; /** diff --git a/src/main/java/thaumic/tinkerer/common/registry/ITTinkererBlock.java b/src/main/java/thaumic/tinkerer/common/registry/ITTinkererBlock.java index 2a4a0d3c..2d8e0d17 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ITTinkererBlock.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ITTinkererBlock.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.registry; import java.util.ArrayList; + import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/thaumic/tinkerer/common/registry/ItemBase.java b/src/main/java/thaumic/tinkerer/common/registry/ItemBase.java index 6cf5e167..94730b2d 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ItemBase.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ItemBase.java @@ -1,26 +1,25 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [8 Sep 2013, 15:44:29 (GMT)] */ package thaumic.tinkerer.common.registry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; + import thaumic.tinkerer.client.core.helper.IconHelper; import thaumic.tinkerer.common.core.handler.ModCreativeTab; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public abstract class ItemBase extends Item implements ITTinkererItem { diff --git a/src/main/java/thaumic/tinkerer/common/registry/ItemKamiBase.java b/src/main/java/thaumic/tinkerer/common/registry/ItemKamiBase.java index 2e3e8d4a..0aa95c26 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ItemKamiBase.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ItemKamiBase.java @@ -4,6 +4,7 @@ import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.research.IRegisterableResearch; public abstract class ItemKamiBase extends ItemBase { + @Override public boolean shouldRegister() { return ConfigHandler.enableKami; diff --git a/src/main/java/thaumic/tinkerer/common/registry/ItemStackCompatator.java b/src/main/java/thaumic/tinkerer/common/registry/ItemStackCompatator.java index a8ab0ce0..33141c6e 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ItemStackCompatator.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ItemStackCompatator.java @@ -1,13 +1,14 @@ package thaumic.tinkerer.common.registry; import java.util.Comparator; + import net.minecraft.item.ItemStack; /** - * Created by pixlepix on 8/3/14. - * Used to sort ItemStacks alphabetically for the creative tab + * Created by pixlepix on 8/3/14. Used to sort ItemStacks alphabetically for the creative tab */ public class ItemStackCompatator implements Comparator { + @Override public int compare(ItemStack o1, ItemStack o2) { return o1.getDisplayName().compareToIgnoreCase(o2.getDisplayName()); diff --git a/src/main/java/thaumic/tinkerer/common/registry/TTRegistry.java b/src/main/java/thaumic/tinkerer/common/registry/TTRegistry.java index 3b42fdf3..22417a2c 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/TTRegistry.java +++ b/src/main/java/thaumic/tinkerer/common/registry/TTRegistry.java @@ -1,9 +1,5 @@ package thaumic.tinkerer.common.registry; -import com.google.common.reflect.ClassPath; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -11,15 +7,23 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; + import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.handler.ModCreativeTab; import thaumic.tinkerer.common.research.IRegisterableResearch; +import com.google.common.reflect.ClassPath; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; + public class TTRegistry { private ArrayList itemClasses = new ArrayList(); @@ -31,15 +35,15 @@ public class TTRegistry { public void registerClasses() { try { ClassPath classPath = ClassPath.from(this.getClass().getClassLoader()); - for (ClassPath.ClassInfo classInfo : - classPath.getTopLevelClassesRecursive("thaumic.tinkerer.common.block")) { + for (ClassPath.ClassInfo classInfo : classPath + .getTopLevelClassesRecursive("thaumic.tinkerer.common.block")) { if (ITTinkererBlock.class.isAssignableFrom(classInfo.load()) && !Modifier.isAbstract(classInfo.load().getModifiers())) { blockClasses.add(classInfo.load()); } } - for (ClassPath.ClassInfo classInfo : - classPath.getTopLevelClassesRecursive("thaumic.tinkerer.common.item")) { + for (ClassPath.ClassInfo classInfo : classPath + .getTopLevelClassesRecursive("thaumic.tinkerer.common.item")) { if (ITTinkererItem.class.isAssignableFrom(classInfo.load()) && !ItemBlock.class.isAssignableFrom(classInfo.load()) && !Modifier.isAbstract(classInfo.load().getModifiers())) { @@ -87,8 +91,7 @@ public class TTRegistry { for (Constructor constructor : clazz.getConstructors()) { if (constructor.getParameterTypes().length > 0 && constructor.getParameterTypes()[0].isAssignableFrom(param.getClass())) { - Block nextBlock = (Block) clazz.getConstructor(param.getClass()) - .newInstance(param); + Block nextBlock = (Block) clazz.getConstructor(param.getClass()).newInstance(param); nextBlock.setBlockName(((ITTinkererBlock) nextBlock).getBlockName()); blockList.add(nextBlock); break; @@ -99,9 +102,7 @@ public class TTRegistry { blockRegistry.put(clazz, blockList); if (((ITTinkererBlock) newBlock).getItemBlock() != null) { - Item newItem = ((ITTinkererBlock) newBlock) - .getItemBlock() - .getConstructor(Block.class) + Item newItem = ((ITTinkererBlock) newBlock).getItemBlock().getConstructor(Block.class) .newInstance(newBlock); newItem.setUnlocalizedName(((ITTinkererItem) newItem).getItemName()); ArrayList itemList = new ArrayList(); @@ -157,7 +158,9 @@ public class TTRegistry { for (Block block : blockArrayList) { if (((ITTinkererBlock) block).getItemBlock() != null) { GameRegistry.registerBlock( - block, ((ITTinkererBlock) block).getItemBlock(), ((ITTinkererBlock) block).getBlockName()); + block, + ((ITTinkererBlock) block).getItemBlock(), + ((ITTinkererBlock) block).getBlockName()); } else { GameRegistry.registerBlock(block, ((ITTinkererBlock) block).getBlockName()); } @@ -168,8 +171,7 @@ public class TTRegistry { } if (block instanceof IMultiTileEntityBlock) { for (Map.Entry, String> tile : ((IMultiTileEntityBlock) block) - .getAdditionalTileEntities() - .entrySet()) { + .getAdditionalTileEntities().entrySet()) { GameRegistry.registerTileEntity(tile.getKey(), tile.getValue()); } } diff --git a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererArcaneRecipe.java b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererArcaneRecipe.java index 6cb6c641..410a5828 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererArcaneRecipe.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererArcaneRecipe.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.registry; import net.minecraft.item.ItemStack; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.ShapedArcaneRecipe; @@ -15,8 +16,8 @@ public class ThaumicTinkererArcaneRecipe extends ThaumicTinkererRecipe { public AspectList aspects; public Object[] recipies; - public ThaumicTinkererArcaneRecipe( - String name, String research, ItemStack output, AspectList aspects, Object... stuff) { + public ThaumicTinkererArcaneRecipe(String name, String research, ItemStack output, AspectList aspects, + Object... stuff) { this.name = name; this.research = research; this.output = output; diff --git a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCraftingBenchRecipe.java b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCraftingBenchRecipe.java index 0e6ce308..fc9c27ce 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCraftingBenchRecipe.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCraftingBenchRecipe.java @@ -1,11 +1,13 @@ package thaumic.tinkerer.common.registry; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; + import thaumcraft.common.config.ConfigResearch; +import cpw.mods.fml.common.registry.GameRegistry; public class ThaumicTinkererCraftingBenchRecipe extends ThaumicTinkererRecipe { diff --git a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCrucibleRecipe.java b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCrucibleRecipe.java index a184ea63..f759deff 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCrucibleRecipe.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererCrucibleRecipe.java @@ -1,6 +1,7 @@ package thaumic.tinkerer.common.registry; import net.minecraft.item.ItemStack; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.CrucibleRecipe; diff --git a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererInfusionRecipe.java b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererInfusionRecipe.java index a1b989f4..af95c300 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererInfusionRecipe.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererInfusionRecipe.java @@ -1,12 +1,14 @@ package thaumic.tinkerer.common.registry; import net.minecraft.item.ItemStack; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.InfusionRecipe; import thaumcraft.common.config.ConfigResearch; public class ThaumicTinkererInfusionRecipe extends ThaumicTinkererRecipe { + private final String name; private final String research; private final Object output; @@ -15,14 +17,8 @@ public class ThaumicTinkererInfusionRecipe extends ThaumicTinkererRecipe { private final ItemStack input; private final ItemStack[] stuff; - public ThaumicTinkererInfusionRecipe( - String name, - String research, - Object output, - int instability, - AspectList aspects, - ItemStack input, - ItemStack... stuff) { + public ThaumicTinkererInfusionRecipe(String name, String research, Object output, int instability, + AspectList aspects, ItemStack input, ItemStack... stuff) { this.name = name; this.research = research; @@ -33,15 +29,15 @@ public class ThaumicTinkererInfusionRecipe extends ThaumicTinkererRecipe { this.stuff = stuff; } - public ThaumicTinkererInfusionRecipe( - String name, Object output, int instability, AspectList aspects, ItemStack input, ItemStack... stuff) { + public ThaumicTinkererInfusionRecipe(String name, Object output, int instability, AspectList aspects, + ItemStack input, ItemStack... stuff) { this(name, name, output, instability, aspects, input, stuff); } @Override public void registerRecipe() { - InfusionRecipe recipe = - ThaumcraftApi.addInfusionCraftingRecipe(research, output, instability, aspects, input, stuff); + InfusionRecipe recipe = ThaumcraftApi + .addInfusionCraftingRecipe(research, output, instability, aspects, input, stuff); ConfigResearch.recipes.put(name, recipe); } } diff --git a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererRecipe.java b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererRecipe.java index f35725cc..7a250978 100644 --- a/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererRecipe.java +++ b/src/main/java/thaumic/tinkerer/common/registry/ThaumicTinkererRecipe.java @@ -2,6 +2,7 @@ package thaumic.tinkerer.common.registry; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; + import thaumic.tinkerer.common.core.handler.ConfigHandler; public abstract class ThaumicTinkererRecipe { diff --git a/src/main/java/thaumic/tinkerer/common/research/EnderStorageRecepie.java b/src/main/java/thaumic/tinkerer/common/research/EnderStorageRecepie.java index 4fe4a14c..a9c6aba4 100644 --- a/src/main/java/thaumic/tinkerer/common/research/EnderStorageRecepie.java +++ b/src/main/java/thaumic/tinkerer/common/research/EnderStorageRecepie.java @@ -6,7 +6,7 @@ public class EnderStorageRecepie { // RecipeHelper.infusionRecipe(LibResearch.KEY_BLOCK_TALISMAN, new ItemStack(ModItems.blockTalisman), 9, new // AspectList().add(Aspect.VOID, 65).add(Aspect.DARKNESS, 32).add(Aspect.MAGIC, 50).add(Aspect.ELDRITCH, 32), // new ItemStack(ConfigItems.itemFocusPortableHole), - // new ItemStack(ModItems.kamiResource), new ItemStack(EnderStorage.blockEnderChest, 0), new + // new ItemStack(ModItems.kamiResource), new ItemStack(EnderStorage.blockEnderChest, 0), new // ItemStack(Item.diamond), new ItemStack(ModItems.kamiResource), new ItemStack(ConfigItems.itemResource, 1, // 11), new ItemStack(ConfigBlocks.blockJar, 1, 3)); } diff --git a/src/main/java/thaumic/tinkerer/common/research/KamiResearchItem.java b/src/main/java/thaumic/tinkerer/common/research/KamiResearchItem.java index f1f6ba45..679d5860 100644 --- a/src/main/java/thaumic/tinkerer/common/research/KamiResearchItem.java +++ b/src/main/java/thaumic/tinkerer/common/research/KamiResearchItem.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [Dec 21, 2013, 8:14:36 PM (GMT)] @@ -17,7 +14,9 @@ package thaumic.tinkerer.common.research; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchCategoryList; @@ -40,37 +39,33 @@ public class KamiResearchItem extends TTResearchItem { @Override public ResearchItem setPages(ResearchPage... par) { - List requirements = parentsHidden == null || parentsHidden.length == 0 - ? new ArrayList() + List requirements = parentsHidden == null || parentsHidden.length == 0 ? new ArrayList() : new ArrayList(Arrays.asList(parentsHidden)); - if (!isAutoUnlock()) - for (String categoryStr : ResearchCategories.researchCategories.keySet()) { - ResearchCategoryList category = ResearchCategories.researchCategories.get(categoryStr); - for (String tag : category.research.keySet()) { - ResearchItem research = category.research.get(tag); + if (!isAutoUnlock()) for (String categoryStr : ResearchCategories.researchCategories.keySet()) { + ResearchCategoryList category = ResearchCategories.researchCategories.get(categoryStr); + for (String tag : category.research.keySet()) { + ResearchItem research = category.research.get(tag); - if (research.isLost() - || research.isVirtual() - || research instanceof KamiResearchItem - || requirements.contains(tag)) continue; - if (research.category.equals(LibResearch.CATEGORY_THAUMICTINKERER) - || research.category.equals("BASICS") - || research.category.equals("GOLEMANCY") - || research.category.equals("ARTIFICE") - || research.category.equals("ALCHEMY") - || research.category.equals("THAUMATURGY")) { - boolean found = false; - for (String black : Blacklist) - if (tag.startsWith(black)) { - found = true; - } - if (tag.endsWith("KAMI")) found = true; - if (found) continue; - requirements.add(tag); + if (research.isLost() || research.isVirtual() + || research instanceof KamiResearchItem + || requirements.contains(tag)) + continue; + if (research.category.equals(LibResearch.CATEGORY_THAUMICTINKERER) || research.category.equals("BASICS") + || research.category.equals("GOLEMANCY") + || research.category.equals("ARTIFICE") + || research.category.equals("ALCHEMY") + || research.category.equals("THAUMATURGY")) { + boolean found = false; + for (String black : Blacklist) if (tag.startsWith(black)) { + found = true; } + if (tag.endsWith("KAMI")) found = true; + if (found) continue; + requirements.add(tag); } } + } parentsHidden = requirements.toArray(new String[requirements.size()]); diff --git a/src/main/java/thaumic/tinkerer/common/research/RecipeHelper.java b/src/main/java/thaumic/tinkerer/common/research/RecipeHelper.java index a834cf0b..b073d4e2 100644 --- a/src/main/java/thaumic/tinkerer/common/research/RecipeHelper.java +++ b/src/main/java/thaumic/tinkerer/common/research/RecipeHelper.java @@ -1,13 +1,10 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 17:02:48 (GMT)] @@ -16,6 +13,7 @@ package thaumic.tinkerer.common.research; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; + import thaumic.tinkerer.common.core.handler.ConfigHandler; public final class RecipeHelper { diff --git a/src/main/java/thaumic/tinkerer/common/research/ResearchHelper.java b/src/main/java/thaumic/tinkerer/common/research/ResearchHelper.java index 7b004e51..a2f8a6c6 100644 --- a/src/main/java/thaumic/tinkerer/common/research/ResearchHelper.java +++ b/src/main/java/thaumic/tinkerer/common/research/ResearchHelper.java @@ -1,25 +1,23 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. * - * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) * - * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) * * File Created @ [4 Sep 2013, 17:02:29 (GMT)] */ package thaumic.tinkerer.common.research; -import cpw.mods.fml.common.Loader; import java.util.Arrays; + import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.CrucibleRecipe; @@ -36,6 +34,7 @@ import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.block.mobilizer.BlockMobilizer; import thaumic.tinkerer.common.block.mobilizer.BlockMobilizerRelay; import thaumic.tinkerer.common.lib.LibResearch; +import cpw.mods.fml.common.Loader; public final class ResearchHelper { @@ -47,197 +46,142 @@ public final class ResearchHelper { ResearchItem research; research = new TTResearchItem( - LibResearch.KEY_ENCHANT_ASCENT_BOOST, - new AspectList() - .add(Aspect.AIR, 1) - .add(Aspect.MOTION, 1) - .add(Aspect.MAGIC, 2), - 6, - 2, - 2, - new ResourceLocation(LibResources.ENCHANT_ASCENT_BOOST)) - .setParents(LibResearch.KEY_ENCHANTER); + LibResearch.KEY_ENCHANT_ASCENT_BOOST, + new AspectList().add(Aspect.AIR, 1).add(Aspect.MOTION, 1).add(Aspect.MAGIC, 2), + 6, + 2, + 2, + new ResourceLocation(LibResources.ENCHANT_ASCENT_BOOST)).setParents(LibResearch.KEY_ENCHANTER); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_SLOW_FALL, - new AspectList() - .add(Aspect.AIR, 1) - .add(Aspect.MOTION, 1) - .add(Aspect.MAGIC, 2), - 7, - 3, - 2, - new ResourceLocation(LibResources.ENCHANT_SLOW_FALL)) - .setParents(LibResearch.KEY_ENCHANTER); + LibResearch.KEY_ENCHANT_SLOW_FALL, + new AspectList().add(Aspect.AIR, 1).add(Aspect.MOTION, 1).add(Aspect.MAGIC, 2), + 7, + 3, + 2, + new ResourceLocation(LibResources.ENCHANT_SLOW_FALL)).setParents(LibResearch.KEY_ENCHANTER); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_AUTO_SMELT, - new AspectList() - .add(Aspect.FIRE, 1) - .add(Aspect.ENTROPY, 1) - .add(Aspect.MAGIC, 2), - 7, - 5, - 2, - new ResourceLocation(LibResources.ENCHANT_AUTO_SMELT)) - .setParents(LibResearch.KEY_ENCHANTER); + LibResearch.KEY_ENCHANT_AUTO_SMELT, + new AspectList().add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1).add(Aspect.MAGIC, 2), + 7, + 5, + 2, + new ResourceLocation(LibResources.ENCHANT_AUTO_SMELT)).setParents(LibResearch.KEY_ENCHANTER); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_DESINTEGRATE, - new AspectList() - .add(Aspect.ENTROPY, 1) - .add(Aspect.VOID, 1) - .add(Aspect.MAGIC, 2), - 6, - 6, - 2, - new ResourceLocation(LibResources.ENCHANT_DESINTEGRATE)) - .setParents(LibResearch.KEY_ENCHANTER); + LibResearch.KEY_ENCHANT_DESINTEGRATE, + new AspectList().add(Aspect.ENTROPY, 1).add(Aspect.VOID, 1).add(Aspect.MAGIC, 2), + 6, + 6, + 2, + new ResourceLocation(LibResources.ENCHANT_DESINTEGRATE)).setParents(LibResearch.KEY_ENCHANTER); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_QUICK_DRAW, - new AspectList() - .add(Aspect.SENSES, 1) - .add(Aspect.WEAPON, 1) - .add(Aspect.MAGIC, 2), - 4, - 6, - 2, - new ResourceLocation(LibResources.ENCHANT_QUICK_DRAW)) - .setParents(LibResearch.KEY_ENCHANTER); + LibResearch.KEY_ENCHANT_QUICK_DRAW, + new AspectList().add(Aspect.SENSES, 1).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 2), + 4, + 6, + 2, + new ResourceLocation(LibResources.ENCHANT_QUICK_DRAW)).setParents(LibResearch.KEY_ENCHANTER); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_VAMPIRISM, - new AspectList() - .add(Aspect.HUNGER, 1) - .add(Aspect.WEAPON, 1) - .add(Aspect.MAGIC, 2), - 3, - 5, - 2, - new ResourceLocation(LibResources.ENCHANT_VAMPIRISM)) - .setParents(LibResearch.KEY_ENCHANTER); + LibResearch.KEY_ENCHANT_VAMPIRISM, + new AspectList().add(Aspect.HUNGER, 1).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 2), + 3, + 5, + 2, + new ResourceLocation(LibResources.ENCHANT_VAMPIRISM)).setParents(LibResearch.KEY_ENCHANTER); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_FOCUSED_STRIKE, - new AspectList() - .add(Aspect.ORDER, 1) - .add(Aspect.WEAPON, 1) - .add(Aspect.MAGIC, 2), - 2, - 7, - 2, - new ResourceLocation(LibResources.ENCHANT_FOCUSED_STRIKE)) - .setParents(LibResearch.KEY_ENCHANT_VAMPIRISM); + LibResearch.KEY_ENCHANT_FOCUSED_STRIKE, + new AspectList().add(Aspect.ORDER, 1).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 2), + 2, + 7, + 2, + new ResourceLocation(LibResources.ENCHANT_FOCUSED_STRIKE)) + .setParents(LibResearch.KEY_ENCHANT_VAMPIRISM); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_DISPERSED_STRIKE, - new AspectList() - .add(Aspect.ENTROPY, 1) - .add(Aspect.WEAPON, 1) - .add(Aspect.MAGIC, 2), - 1, - 6, - 2, - new ResourceLocation(LibResources.ENCHANT_DISPERSED_STRIKE)) - .setParents(LibResearch.KEY_ENCHANT_VAMPIRISM); + LibResearch.KEY_ENCHANT_DISPERSED_STRIKE, + new AspectList().add(Aspect.ENTROPY, 1).add(Aspect.WEAPON, 1).add(Aspect.MAGIC, 2), + 1, + 6, + 2, + new ResourceLocation(LibResources.ENCHANT_DISPERSED_STRIKE)) + .setParents(LibResearch.KEY_ENCHANT_VAMPIRISM); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_FINAL_STRIKE, - new AspectList() - .add(Aspect.ENTROPY, 3) - .add(Aspect.ORDER, 3) - .add(Aspect.WEAPON, 3) - .add(Aspect.MAGIC, 2), - 0, - 8, - 2, - new ResourceLocation(LibResources.ENCHANT_FINAL_STRIKE)) - .setParents(LibResearch.KEY_ENCHANT_FOCUSED_STRIKE, LibResearch.KEY_ENCHANT_DISPERSED_STRIKE); + LibResearch.KEY_ENCHANT_FINAL_STRIKE, + new AspectList().add(Aspect.ENTROPY, 3).add(Aspect.ORDER, 3).add(Aspect.WEAPON, 3).add(Aspect.MAGIC, 2), + 0, + 8, + 2, + new ResourceLocation(LibResources.ENCHANT_FINAL_STRIKE)) + .setParents(LibResearch.KEY_ENCHANT_FOCUSED_STRIKE, LibResearch.KEY_ENCHANT_DISPERSED_STRIKE); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_POUNCE, - new AspectList() - .add(Aspect.AIR, 3) - .add(Aspect.ORDER, 3) - .add(Aspect.ARMOR, 3) - .add(Aspect.MAGIC, 2), - 7, - 0, - 2, - new ResourceLocation(LibResources.ENCHANT_POUNCE)) - .setParents(LibResearch.KEY_ENCHANT_ASCENT_BOOST); + LibResearch.KEY_ENCHANT_POUNCE, + new AspectList().add(Aspect.AIR, 3).add(Aspect.ORDER, 3).add(Aspect.ARMOR, 3).add(Aspect.MAGIC, 2), + 7, + 0, + 2, + new ResourceLocation(LibResources.ENCHANT_POUNCE)).setParents(LibResearch.KEY_ENCHANT_ASCENT_BOOST); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_SHATTER, - new AspectList() - .add(Aspect.EARTH, 3) - .add(Aspect.ENTROPY, 3) - .add(Aspect.TOOL, 1) - .add(Aspect.MAGIC, 2), - 5, - 8, - 2, - new ResourceLocation(LibResources.ENCHANT_SHATTER)) - .setParents(LibResearch.KEY_ENCHANT_DESINTEGRATE); + LibResearch.KEY_ENCHANT_SHATTER, + new AspectList().add(Aspect.EARTH, 3).add(Aspect.ENTROPY, 3).add(Aspect.TOOL, 1).add(Aspect.MAGIC, 2), + 5, + 8, + 2, + new ResourceLocation(LibResources.ENCHANT_SHATTER)).setParents(LibResearch.KEY_ENCHANT_DESINTEGRATE); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_SHOCKWAVE, - new AspectList() - .add(Aspect.AIR, 3) - .add(Aspect.ENTROPY, 3) - .add(Aspect.ARMOR, 1) - .add(Aspect.MAGIC, 2), - 9, - 2, - 2, - new ResourceLocation(LibResources.ENCHANT_SHOCKWAVE)) - .setParents(LibResearch.KEY_ENCHANT_SLOW_FALL); + LibResearch.KEY_ENCHANT_SHOCKWAVE, + new AspectList().add(Aspect.AIR, 3).add(Aspect.ENTROPY, 3).add(Aspect.ARMOR, 1).add(Aspect.MAGIC, 2), + 9, + 2, + 2, + new ResourceLocation(LibResources.ENCHANT_SHOCKWAVE)).setParents(LibResearch.KEY_ENCHANT_SLOW_FALL); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_TUNNEL, - new AspectList() - .add(Aspect.EARTH, 3) - .add(Aspect.ORDER, 3) - .add(Aspect.TOOL, 1) - .add(Aspect.MAGIC, 2), - 9, - 6, - 2, - new ResourceLocation(LibResources.ENCHANT_TUNNEL)) - .setParents(LibResearch.KEY_ENCHANT_AUTO_SMELT); + LibResearch.KEY_ENCHANT_TUNNEL, + new AspectList().add(Aspect.EARTH, 3).add(Aspect.ORDER, 3).add(Aspect.TOOL, 1).add(Aspect.MAGIC, 2), + 9, + 6, + 2, + new ResourceLocation(LibResources.ENCHANT_TUNNEL)).setParents(LibResearch.KEY_ENCHANT_AUTO_SMELT); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); research = new TTResearchItem( - LibResearch.KEY_ENCHANT_VALIANCE, - new AspectList() - .add(Aspect.WEAPON, 3) - .add(Aspect.HEAL, 3) - .add(Aspect.MAGIC, 2), - 1, - 4, - 2, - new ResourceLocation(LibResources.ENCHANT_VALIANCE)) - .setParents(LibResearch.KEY_ENCHANT_VAMPIRISM); + LibResearch.KEY_ENCHANT_VALIANCE, + new AspectList().add(Aspect.WEAPON, 3).add(Aspect.HEAL, 3).add(Aspect.MAGIC, 2), + 1, + 4, + 2, + new ResourceLocation(LibResources.ENCHANT_VALIANCE)).setParents(LibResearch.KEY_ENCHANT_VAMPIRISM); research.setPages(new ResearchPage("0")).setSecondary().registerResearchItem(); // Peripheral documentation research if (Loader.isModLoaded("ComputerCraft")) { research = new TTResearchItem( - LibResearch.KEY_PERIPHERALS, new AspectList(), -1, 0, 0, new ItemStack(Items.redstone)) - .setAutoUnlock() - .setRound(); + LibResearch.KEY_PERIPHERALS, + new AspectList(), + -1, + 0, + 0, + new ItemStack(Items.redstone)).setAutoUnlock().setRound(); research.setPages(new ResearchPage("0")).registerResearchItem(); } } @@ -245,7 +189,9 @@ public final class ResearchHelper { private static void registerResearchPages() { ResourceLocation background = new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png"); ResearchCategories.registerCategory( - LibResearch.CATEGORY_THAUMICTINKERER, new ResourceLocation(LibResources.MISC_R_ENCHANTING), background); + LibResearch.CATEGORY_THAUMICTINKERER, + new ResourceLocation(LibResources.MISC_R_ENCHANTING), + background); } public static ResearchPage recipePage(String name) { @@ -280,16 +226,19 @@ public final class ResearchHelper { } public static ResearchPage LeviationaryHelp() { - return new ResearchPage(Arrays.asList( - (new AspectList()), - 5, - 1, - 1, + return new ResearchPage( Arrays.asList( - new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockMobilizerRelay.class)), - new ItemStack(ConfigBlocks.blockHole, 1, 15), - new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockMobilizer.class)), - new ItemStack(ConfigBlocks.blockHole, 1, 15), - new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockMobilizerRelay.class))))); + (new AspectList()), + 5, + 1, + 1, + Arrays.asList( + new ItemStack( + ThaumicTinkerer.registry.getFirstBlockFromClass(BlockMobilizerRelay.class)), + new ItemStack(ConfigBlocks.blockHole, 1, 15), + new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockMobilizer.class)), + new ItemStack(ConfigBlocks.blockHole, 1, 15), + new ItemStack( + ThaumicTinkerer.registry.getFirstBlockFromClass(BlockMobilizerRelay.class))))); } } diff --git a/src/main/java/thaumic/tinkerer/common/research/TTResearchItem.java b/src/main/java/thaumic/tinkerer/common/research/TTResearchItem.java index fc47d392..ab5d6dcd 100644 --- a/src/main/java/thaumic/tinkerer/common/research/TTResearchItem.java +++ b/src/main/java/thaumic/tinkerer/common/research/TTResearchItem.java @@ -1,24 +1,20 @@ /** - * This class was created by . It's distributed as - * part of the ThaumicTinkerer Mod. + * This class was created by . It's distributed as part of the ThaumicTinkerer Mod. *

- * ThaumicTinkerer is Open Source and distributed under a - * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License - * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 + * License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) *

- * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. - * Thaumcraft 4 (c) Azanor 2012 + * ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012 * (http://www.minecraftforum.net/topic/1585216-) *

* File Created @ [8 Sep 2013, 16:53:14 (GMT)] */ package thaumic.tinkerer.common.research; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchItem; @@ -26,14 +22,16 @@ import thaumcraft.api.research.ResearchPage; import thaumcraft.api.research.ResearchPage.PageType; import thaumic.tinkerer.common.core.handler.ConfigHandler; import thaumic.tinkerer.common.lib.LibResearch; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class TTResearchItem extends ResearchItem implements IRegisterableResearch { public int warp = 0; /** - * When ModTweaker scripts replace ThaumicTinkerer pages, it call {@link #setPages(ResearchPage...)} - * and if one of provided pages is text page, - * Thaumic Tinkerer will generate its own {@link ResearchPage#text} adding prefixes to the existing one that breaks localization. + * When ModTweaker scripts replace ThaumicTinkerer pages, it call {@link #setPages(ResearchPage...)} and if one of + * provided pages is text page, Thaumic Tinkerer will generate its own {@link ResearchPage#text} adding prefixes to + * the existing one that breaks localization. *

* So this variable will prevent Thaumic Tinkerer from changing page's text that came from MineTweaker scripts. */ @@ -81,11 +79,11 @@ public class TTResearchItem extends ResearchItem implements IRegisterableResearc } if (checkInfusion() && page.type == PageType.INFUSION_CRAFTING) { - if (parentsHidden == null || parentsHidden.length == 0) parentsHidden = new String[] {"INFUSION"}; + if (parentsHidden == null || parentsHidden.length == 0) parentsHidden = new String[] { "INFUSION" }; else { String[] newParents = new String[parentsHidden.length + 1]; newParents[0] = "INFUSION"; - //noinspection ManualArrayCopy + // noinspection ManualArrayCopy for (int i = 0; i < parentsHidden.length; i++) newParents[i + 1] = parentsHidden[i]; parentsHidden = newParents; } diff --git a/src/main/java/thaumic/tinkerer/preloader/ThaumicTLoaderContainer.java b/src/main/java/thaumic/tinkerer/preloader/ThaumicTLoaderContainer.java index ae3e518f..ba5895d3 100644 --- a/src/main/java/thaumic/tinkerer/preloader/ThaumicTLoaderContainer.java +++ b/src/main/java/thaumic/tinkerer/preloader/ThaumicTLoaderContainer.java @@ -1,15 +1,18 @@ package thaumic.tinkerer.preloader; +import java.util.Arrays; +import java.util.Map; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import com.google.common.eventbus.EventBus; + import cpw.mods.fml.common.DummyModContainer; import cpw.mods.fml.common.LoadController; import cpw.mods.fml.common.ModMetadata; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; -import java.util.Arrays; -import java.util.Map; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; /** * Created by Katrina on 06/04/14.