From ae21012d216df71f31aed6fbc9d76215fc24ceed Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 4 Mar 2017 12:58:47 +1000 Subject: + New texture for the slow builders ring. + Added the Alkalus Disk. $ Fixed Frame Box Assembler Recipes. $ Fixed Missing 7Li material. $ Fixed Tiered Tanks not showing their capacity in the tooltip. $ Fixed tooltips for alloys containing Bronze or Steel. $ Fixed Clay Pipe Extruder Recipes. - Removed a handful of Plasma cells for misc. materials. % Changed the Industrial Coke Oven's tooltip, to better describe the input/output requirements. % Cleaned up The Entire Project. --- src/Java/gtPlusPlus/core/slots/SlotBlueprint.java | 6 +- src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java | 22 +- src/Java/gtPlusPlus/core/slots/SlotCrafting.java | 295 +++++++++++---------- src/Java/gtPlusPlus/core/slots/SlotFrame.java | 6 +- src/Java/gtPlusPlus/core/slots/SlotGeneric.java | 4 +- src/Java/gtPlusPlus/core/slots/SlotGtTool.java | 6 +- .../gtPlusPlus/core/slots/SlotGtToolElectric.java | 30 +-- .../gtPlusPlus/core/slots/SlotItemBackpackInv.java | 4 +- src/Java/gtPlusPlus/core/slots/SlotNoInput.java | 4 +- src/Java/gtPlusPlus/core/slots/SlotOutput.java | 22 +- src/Java/gtPlusPlus/core/slots/SlotRTG.java | 4 +- 11 files changed, 204 insertions(+), 199 deletions(-) (limited to 'src/Java/gtPlusPlus/core/slots') diff --git a/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java b/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java index 3c5c30966e..99c6eca8df 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java +++ b/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java @@ -8,17 +8,17 @@ import net.minecraft.item.ItemStack; public class SlotBlueprint extends Slot{ - public SlotBlueprint(IInventory inventory, int x, int y, int z) { + public SlotBlueprint(final IInventory inventory, final int x, final int y, final int z) { super(inventory, x, y, z); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { if (itemstack.getItem() instanceof IItemBlueprint){ Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Blueprint."); return true; } - Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Blueprint."); + Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Blueprint."); return false; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java b/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java index 0d8ce34ab5..2434344184 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java +++ b/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java @@ -11,43 +11,43 @@ public class SlotBuzzSaw extends Slot{ public SAWTOOL currentTool = SAWTOOL.NONE; - public SlotBuzzSaw(IInventory inventory, int slot, int x, int y) { + public SlotBuzzSaw(final IInventory inventory, final int slot, final int x, final int y) { super(inventory, slot, x, y); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { boolean isValid = false; if (itemstack != null){ - if (itemstack.getItem() instanceof GT_MetaGenerated_Item_02 || itemstack.getItem() instanceof GT_MetaGenerated_Tool){ + if ((itemstack.getItem() instanceof GT_MetaGenerated_Item_02) || (itemstack.getItem() instanceof GT_MetaGenerated_Tool)){ //Buzzsaw Blade //TODO /*if (OrePrefixes.toolHeadBuzzSaw.contains(itemstack)){ - isValid = false; + isValid = false; }*/ if (OrePrefixes.craftingTool.contains(itemstack)){ - if (itemstack.getDisplayName().toLowerCase().contains("saw")){ + if (itemstack.getDisplayName().toLowerCase().contains("saw")){ if (itemstack.getItemDamage() == 10){ isValid = true; - currentTool = SAWTOOL.SAW; + this.currentTool = SAWTOOL.SAW; } if (itemstack.getItemDamage() == 140){ isValid = true; - currentTool = SAWTOOL.BUZZSAW; + this.currentTool = SAWTOOL.BUZZSAW; } } } else { - currentTool = SAWTOOL.NONE; + this.currentTool = SAWTOOL.NONE; } } else { - currentTool = SAWTOOL.NONE; + this.currentTool = SAWTOOL.NONE; } - } + } else { - currentTool = SAWTOOL.NONE; + this.currentTool = SAWTOOL.NONE; } return isValid; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotCrafting.java b/src/Java/gtPlusPlus/core/slots/SlotCrafting.java index d38de0e0a4..6bcf3ed58c 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotCrafting.java +++ b/src/Java/gtPlusPlus/core/slots/SlotCrafting.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.slots; +import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -9,152 +10,156 @@ import net.minecraft.item.*; import net.minecraft.stats.AchievementList; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; -import cpw.mods.fml.common.FMLCommonHandler; public class SlotCrafting extends Slot { - /** The craft matrix inventory linked to this result slot. */ - private final IInventory craftMatrix; - /** The player that is using the GUI where this slot resides. */ - private EntityPlayer thePlayer; - /** The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. */ - private int amountCrafted; - private static final String __OBFID = "CL_00001761"; - - public SlotCrafting(EntityPlayer p_i1823_1_, IInventory p_i1823_2_, IInventory p_i1823_3_, int p_i1823_4_, int p_i1823_5_, int p_i1823_6_) - { - super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_); - this.thePlayer = p_i1823_1_; - this.craftMatrix = p_i1823_2_; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - public boolean isItemValid(ItemStack p_75214_1_) - { - return false; - } - - /** - * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new - * stack. - */ - public ItemStack decrStackSize(int p_75209_1_) - { - if (this.getHasStack()) - { - this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize); - } - - return super.decrStackSize(p_75209_1_); - } - - /** - * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an - * internal count then calls onCrafting(item). - */ - protected void onCrafting(ItemStack p_75210_1_, int p_75210_2_) - { - this.amountCrafted += p_75210_2_; - this.onCrafting(p_75210_1_); - } - - /** - * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. - */ - protected void onCrafting(ItemStack p_75208_1_) - { - p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); - this.amountCrafted = 0; - - if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) - { - this.thePlayer.addStat(AchievementList.buildWorkBench, 1); - } - - if (p_75208_1_.getItem() instanceof ItemPickaxe) - { - this.thePlayer.addStat(AchievementList.buildPickaxe, 1); - } - - if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) - { - this.thePlayer.addStat(AchievementList.buildFurnace, 1); - } - - if (p_75208_1_.getItem() instanceof ItemHoe) - { - this.thePlayer.addStat(AchievementList.buildHoe, 1); - } - - if (p_75208_1_.getItem() == Items.bread) - { - this.thePlayer.addStat(AchievementList.makeBread, 1); - } - - if (p_75208_1_.getItem() == Items.cake) - { - this.thePlayer.addStat(AchievementList.bakeCake, 1); - } - - if (p_75208_1_.getItem() instanceof ItemPickaxe && ((ItemPickaxe)p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD) - { - this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1); - } - - if (p_75208_1_.getItem() instanceof ItemSword) - { - this.thePlayer.addStat(AchievementList.buildSword, 1); - } - - if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) - { - this.thePlayer.addStat(AchievementList.enchantments, 1); - } - - if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) - { - this.thePlayer.addStat(AchievementList.bookcase, 1); - } - } - - public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) - { - FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, craftMatrix); - this.onCrafting(p_82870_2_); - - for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) - { - ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); - - if (itemstack1 != null) - { - this.craftMatrix.decrStackSize(i, 1); - - if (itemstack1.getItem().hasContainerItem(itemstack1)) - { - ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); - - if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) - { - MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); - continue; - } - - if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) - { - if (this.craftMatrix.getStackInSlot(i) == null) - { - this.craftMatrix.setInventorySlotContents(i, itemstack2); - } - else - { - this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); - } - } - } - } - } - } + /** The craft matrix inventory linked to this result slot. */ + private final IInventory craftMatrix; + /** The player that is using the GUI where this slot resides. */ + private final EntityPlayer thePlayer; + /** The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. */ + private int amountCrafted; + private static final String __OBFID = "CL_00001761"; + + public SlotCrafting(final EntityPlayer p_i1823_1_, final IInventory p_i1823_2_, final IInventory p_i1823_3_, final int p_i1823_4_, final int p_i1823_5_, final int p_i1823_6_) + { + super(p_i1823_3_, p_i1823_4_, p_i1823_5_, p_i1823_6_); + this.thePlayer = p_i1823_1_; + this.craftMatrix = p_i1823_2_; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + @Override + public boolean isItemValid(final ItemStack p_75214_1_) + { + return false; + } + + /** + * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new + * stack. + */ + @Override + public ItemStack decrStackSize(final int p_75209_1_) + { + if (this.getHasStack()) + { + this.amountCrafted += Math.min(p_75209_1_, this.getStack().stackSize); + } + + return super.decrStackSize(p_75209_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + @Override + protected void onCrafting(final ItemStack p_75210_1_, final int p_75210_2_) + { + this.amountCrafted += p_75210_2_; + this.onCrafting(p_75210_1_); + } + + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + @Override + protected void onCrafting(final ItemStack p_75208_1_) + { + p_75208_1_.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); + this.amountCrafted = 0; + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) + { + this.thePlayer.addStat(AchievementList.buildWorkBench, 1); + } + + if (p_75208_1_.getItem() instanceof ItemPickaxe) + { + this.thePlayer.addStat(AchievementList.buildPickaxe, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.furnace)) + { + this.thePlayer.addStat(AchievementList.buildFurnace, 1); + } + + if (p_75208_1_.getItem() instanceof ItemHoe) + { + this.thePlayer.addStat(AchievementList.buildHoe, 1); + } + + if (p_75208_1_.getItem() == Items.bread) + { + this.thePlayer.addStat(AchievementList.makeBread, 1); + } + + if (p_75208_1_.getItem() == Items.cake) + { + this.thePlayer.addStat(AchievementList.bakeCake, 1); + } + + if ((p_75208_1_.getItem() instanceof ItemPickaxe) && (((ItemPickaxe)p_75208_1_.getItem()).func_150913_i() != Item.ToolMaterial.WOOD)) + { + this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1); + } + + if (p_75208_1_.getItem() instanceof ItemSword) + { + this.thePlayer.addStat(AchievementList.buildSword, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) + { + this.thePlayer.addStat(AchievementList.enchantments, 1); + } + + if (p_75208_1_.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) + { + this.thePlayer.addStat(AchievementList.bookcase, 1); + } + } + + @Override + public void onPickupFromSlot(final EntityPlayer p_82870_1_, final ItemStack p_82870_2_) + { + FMLCommonHandler.instance().firePlayerCraftingEvent(p_82870_1_, p_82870_2_, this.craftMatrix); + this.onCrafting(p_82870_2_); + + for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) + { + final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); + + if (itemstack1 != null) + { + this.craftMatrix.decrStackSize(i, 1); + + if (itemstack1.getItem().hasContainerItem(itemstack1)) + { + final ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); + + if ((itemstack2 != null) && itemstack2.isItemStackDamageable() && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) + { + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2)); + continue; + } + + if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1) || !this.thePlayer.inventory.addItemStackToInventory(itemstack2)) + { + if (this.craftMatrix.getStackInSlot(i) == null) + { + this.craftMatrix.setInventorySlotContents(i, itemstack2); + } + else + { + this.thePlayer.dropPlayerItemWithRandomChoice(itemstack2, false); + } + } + } + } + } + } } \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/slots/SlotFrame.java b/src/Java/gtPlusPlus/core/slots/SlotFrame.java index 13bc8fa717..bb2cabc61f 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotFrame.java +++ b/src/Java/gtPlusPlus/core/slots/SlotFrame.java @@ -1,19 +1,19 @@ package gtPlusPlus.core.slots; +import forestry.api.apiculture.IHiveFrame; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import forestry.api.apiculture.IHiveFrame; public class SlotFrame extends Slot{ - public SlotFrame(IInventory inventory, int x, int y, int z) { + public SlotFrame(final IInventory inventory, final int x, final int y, final int z) { super(inventory, x, y, z); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { return itemstack.getItem() instanceof IHiveFrame; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotGeneric.java b/src/Java/gtPlusPlus/core/slots/SlotGeneric.java index bf7dc1fff5..7ff350845e 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotGeneric.java +++ b/src/Java/gtPlusPlus/core/slots/SlotGeneric.java @@ -6,13 +6,13 @@ import net.minecraft.item.ItemStack; public class SlotGeneric extends Slot{ - public SlotGeneric(IInventory inventory, int x, int y, int z) { + public SlotGeneric(final IInventory inventory, final int x, final int y, final int z) { super(inventory, x, y, z); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { return true; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java index cdea2fa43f..a2fd83baee 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java +++ b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java @@ -8,18 +8,18 @@ import net.minecraft.item.ItemStack; public class SlotGtTool extends Slot{ - public SlotGtTool(IInventory inventory, int x, int y, int z) { + public SlotGtTool(final IInventory inventory, final int x, final int y, final int z) { super(inventory, x, y, z); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { if (itemstack.getItem() instanceof GT_MetaGenerated_Tool){ Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Tool."); return true; } - Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool."); + Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool."); return false; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java index 461fa6ff04..46ceb3209e 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java +++ b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java @@ -13,14 +13,14 @@ public class SlotGtToolElectric extends SlotGtTool { public int tier; private ItemStack content; - public SlotGtToolElectric(IInventory base, int x, int y, int z, int tier, boolean allowRedstoneDust) + public SlotGtToolElectric(final IInventory base, final int x, final int y, final int z, final int tier, final boolean allowRedstoneDust) { super(base, x, y, z); this.tier = tier; this.allowRedstoneDust = allowRedstoneDust; } - public boolean accepts(ItemStack stack) + public boolean accepts(final ItemStack stack) { if (stack == null) { return false; @@ -31,12 +31,12 @@ public class SlotGtToolElectric extends SlotGtTool { return (Info.itemEnergy.getEnergyValue(stack) > 0.0D) || (ElectricItem.manager.discharge(stack, (1.0D / 0.0D), this.tier, true, true, true) > 0.0D); } - public double discharge(double amount, boolean ignoreLimit) + public double discharge(final double amount, final boolean ignoreLimit) { if (amount <= 0.0D) { throw new IllegalArgumentException("Amount must be > 0."); } - ItemStack stack = get(0); + final ItemStack stack = this.get(0); if (stack == null) { return 0.0D; } @@ -49,13 +49,13 @@ public class SlotGtToolElectric extends SlotGtTool { } stack.stackSize -= 1; if (stack.stackSize <= 0) { - put(0, null); + this.put(0, null); } } return realAmount; } - public void setTier(int tier1) + public void setTier(final int tier1) { this.tier = tier1; } @@ -64,34 +64,34 @@ public class SlotGtToolElectric extends SlotGtTool { public ItemStack get() { - return get(0); + return this.get(0); } - public ItemStack get(int index) + public ItemStack get(final int index) { return this.content; } - public void put(ItemStack content) + public void put(final ItemStack content) { - put(0, content); + this.put(0, content); } - public void put(int index, ItemStack content) + public void put(final int index, final ItemStack content) { this.content = content; - onChanged(); + this.onChanged(); } public void onChanged() {} @Override - public boolean isItemValid(ItemStack itemstack) { - if (itemstack.getItem() instanceof GT_MetaGenerated_Tool || itemstack.getItem() instanceof IElectricItem){ + public boolean isItemValid(final ItemStack itemstack) { + if ((itemstack.getItem() instanceof GT_MetaGenerated_Tool) || (itemstack.getItem() instanceof IElectricItem)){ Utils.LOG_WARNING(itemstack.getDisplayName()+" is a valid Tool."); return true; } - Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool."); + Utils.LOG_WARNING(itemstack.getDisplayName()+" is not a valid Tool."); return false; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java b/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java index 7a22086949..fbc3e36aef 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java +++ b/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java @@ -7,7 +7,7 @@ import net.minecraft.item.ItemStack; public class SlotItemBackpackInv extends Slot { - public SlotItemBackpackInv(IInventory inv, int index, int xPos, int yPos) + public SlotItemBackpackInv(final IInventory inv, final int index, final int xPos, final int yPos) { super(inv, index, xPos, yPos); } @@ -20,7 +20,7 @@ public class SlotItemBackpackInv extends Slot * Check if the stack is a valid item for this slot. */ @Override - public boolean isItemValid(ItemStack itemstack) + public boolean isItemValid(final ItemStack itemstack) { // Everything returns true except an instance of our Item return !(itemstack.getItem() instanceof BaseItemBackpack); diff --git a/src/Java/gtPlusPlus/core/slots/SlotNoInput.java b/src/Java/gtPlusPlus/core/slots/SlotNoInput.java index fe51631a5d..3177c24868 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotNoInput.java +++ b/src/Java/gtPlusPlus/core/slots/SlotNoInput.java @@ -6,12 +6,12 @@ import net.minecraft.item.ItemStack; public class SlotNoInput extends Slot{ - public SlotNoInput(IInventory inventory, int x, int y, int z) { + public SlotNoInput(final IInventory inventory, final int x, final int y, final int z) { super(inventory, x, y, z); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { return false; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotOutput.java b/src/Java/gtPlusPlus/core/slots/SlotOutput.java index a0f895d554..9219b50261 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotOutput.java +++ b/src/Java/gtPlusPlus/core/slots/SlotOutput.java @@ -1,12 +1,12 @@ package gtPlusPlus.core.slots; +import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; -import cpw.mods.fml.common.FMLCommonHandler; public class SlotOutput extends SlotCrafting{ @@ -15,7 +15,7 @@ public class SlotOutput extends SlotCrafting{ private int amountCrafted; - public SlotOutput(EntityPlayer player, InventoryCrafting craftingInventory, IInventory p_i45790_3_, int slotIndex, int xPosition, int yPosition) + public SlotOutput(final EntityPlayer player, final InventoryCrafting craftingInventory, final IInventory p_i45790_3_, final int slotIndex, final int xPosition, final int yPosition) { super(player, craftingInventory, p_i45790_3_, slotIndex, xPosition, yPosition); this.thePlayer = player; @@ -25,7 +25,7 @@ public class SlotOutput extends SlotCrafting{ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. */ @Override - public boolean isItemValid(ItemStack par1ItemStack) + public boolean isItemValid(final ItemStack par1ItemStack) { return false; } @@ -34,7 +34,7 @@ public class SlotOutput extends SlotCrafting{ * stack. */ @Override - public ItemStack decrStackSize(int par1) + public ItemStack decrStackSize(final int par1) { if (this.getHasStack()) { @@ -47,7 +47,7 @@ public class SlotOutput extends SlotCrafting{ * internal count then calls onCrafting(item). */ @Override - protected void onCrafting(ItemStack par1ItemStack, int par2) + protected void onCrafting(final ItemStack par1ItemStack, final int par2) { this.amountCrafted += par2; this.onCrafting(par1ItemStack); @@ -56,30 +56,30 @@ public class SlotOutput extends SlotCrafting{ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. */ @Override - protected void onCrafting(ItemStack stack) + protected void onCrafting(final ItemStack stack) { stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); this.amountCrafted = 0; } @Override - public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack) + public void onPickupFromSlot(final EntityPlayer playerIn, final ItemStack stack) { { - FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix); + FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, this.craftMatrix); this.onCrafting(stack); for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) { - ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); + final ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); if (itemstack1 != null) { this.craftMatrix.decrStackSize(i, 1); if (itemstack1.getItem().hasContainerItem(itemstack1)) { ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); - if (itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) + if (itemstack2.isItemStackDamageable() && (itemstack2.getItemDamage() > itemstack2.getMaxDamage())) { - MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, itemstack2)); + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(this.thePlayer, itemstack2)); itemstack2 = null; } if (!this.thePlayer.inventory.addItemStackToInventory(itemstack2)) diff --git a/src/Java/gtPlusPlus/core/slots/SlotRTG.java b/src/Java/gtPlusPlus/core/slots/SlotRTG.java index 1f16463de2..398bae08a5 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotRTG.java +++ b/src/Java/gtPlusPlus/core/slots/SlotRTG.java @@ -7,13 +7,13 @@ import net.minecraft.item.ItemStack; public class SlotRTG extends Slot{ - public SlotRTG(IInventory inventory, int x, int y, int z) { + public SlotRTG(final IInventory inventory, final int x, final int y, final int z) { super(inventory, x, y, z); } @Override - public boolean isItemValid(ItemStack itemstack) { + public boolean isItemValid(final ItemStack itemstack) { return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass(); } -- cgit