diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/slots')
6 files changed, 40 insertions, 28 deletions
diff --git a/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java b/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java index 0b8235fcd8..603021237a 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java +++ b/src/Java/gtPlusPlus/core/slots/SlotBlueprint.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.interfaces.IItemBlueprint; -import gtPlusPlus.core.util.Utils; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -15,10 +15,10 @@ public class SlotBlueprint extends Slot { @Override public boolean isItemValid(final ItemStack itemstack) { if (itemstack.getItem() instanceof IItemBlueprint) { - Utils.LOG_WARNING(itemstack.getDisplayName() + " is a valid Blueprint."); + Logger.WARNING(itemstack.getDisplayName() + " is a valid Blueprint."); return true; } - Utils.LOG_WARNING(itemstack.getDisplayName() + " is not a valid Blueprint."); + Logger.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 3578eaedf1..af7c7c9c59 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java +++ b/src/Java/gtPlusPlus/core/slots/SlotBuzzSaw.java @@ -31,25 +31,36 @@ public class SlotBuzzSaw extends Slot { if (OrePrefixes.craftingTool.contains(itemstack)) { if (itemstack.getDisplayName().toLowerCase().contains("saw") || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.10") + || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.110") + || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.112") + || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.114") || itemstack.getDisplayName().toLowerCase().contains("gt.metatool.01.140")) { if (itemstack.getItemDamage() == 10) { isValid = true; this.currentTool = SAWTOOL.SAW; } - if (itemstack.getItemDamage() == 140) { + else if (itemstack.getItemDamage() == 110) { + isValid = true; + this.currentTool = SAWTOOL.CHAINSAW; + } + else if (itemstack.getItemDamage() == 112) { + isValid = true; + this.currentTool = SAWTOOL.CHAINSAW; + } + else if (itemstack.getItemDamage() == 114) { + isValid = true; + this.currentTool = SAWTOOL.CHAINSAW; + } + else if (itemstack.getItemDamage() == 140) { isValid = true; this.currentTool = SAWTOOL.BUZZSAW; } + return isValid; } - } else { - this.currentTool = SAWTOOL.NONE; - } - } else { - this.currentTool = SAWTOOL.NONE; - } - } else { - this.currentTool = SAWTOOL.NONE; - } + } + } + } + this.currentTool = SAWTOOL.NONE; return isValid; } @@ -59,7 +70,7 @@ public class SlotBuzzSaw extends Slot { } public enum SAWTOOL { - NONE, SAW, BUZZSAW + NONE, SAW, BUZZSAW, CHAINSAW } } diff --git a/src/Java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java b/src/Java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java index 879ba87a0b..286eff9612 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java +++ b/src/Java/gtPlusPlus/core/slots/SlotCraftingNoCollect.java @@ -5,11 +5,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemHoe; -import net.minecraft.item.ItemPickaxe; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; +import net.minecraft.item.*; import net.minecraft.stats.AchievementList; public class SlotCraftingNoCollect extends SlotCrafting { @@ -34,6 +30,7 @@ public class SlotCraftingNoCollect 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 p_75214_1_) { return false; } @@ -42,6 +39,7 @@ public class SlotCraftingNoCollect extends SlotCrafting { * 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(int amount) { if (this.getHasStack()) { this.amountCrafted += Math.min(amount, this.getStack().stackSize); @@ -55,6 +53,7 @@ public class SlotCraftingNoCollect extends SlotCrafting { * not ore and wood. Typically increases an internal count then calls * onCrafting(item). */ + @Override protected void onCrafting(ItemStack output, int amount) { this.amountCrafted += amount; this.onCrafting(output); @@ -64,6 +63,7 @@ public class SlotCraftingNoCollect extends SlotCrafting { * the itemStack passed in is the output - ie, iron ingots, and pickaxes, * not ore and wood. */ + @Override protected void onCrafting(ItemStack output) { output.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); this.amountCrafted = 0; @@ -110,6 +110,7 @@ public class SlotCraftingNoCollect extends SlotCrafting { } } + @Override public void onPickupFromSlot(EntityPlayer player, ItemStack output) { FMLCommonHandler.instance().firePlayerCraftingEvent(player, output, craftMatrix); this.onCrafting(output); diff --git a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java index cfa501eb1e..e70ae728c9 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotGtTool.java +++ b/src/Java/gtPlusPlus/core/slots/SlotGtTool.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; import gregtech.api.items.GT_MetaGenerated_Tool; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; @@ -16,10 +16,10 @@ public class SlotGtTool extends Slot { @Override public boolean isItemValid(final ItemStack itemstack) { if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) { - Utils.LOG_WARNING(itemstack.getDisplayName() + " is a valid Tool."); + Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool."); return true; } - Utils.LOG_WARNING(itemstack.getDisplayName() + " is not a valid Tool."); + Logger.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 7fab32903a..1e488a0e46 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java +++ b/src/Java/gtPlusPlus/core/slots/SlotGtToolElectric.java @@ -1,7 +1,7 @@ package gtPlusPlus.core.slots; import gregtech.api.items.GT_MetaGenerated_Tool; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import ic2.api.info.Info; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; @@ -82,10 +82,10 @@ public class SlotGtToolElectric extends SlotGtTool { @Override 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."); + Logger.WARNING(itemstack.getDisplayName() + " is a valid Tool."); return true; } - Utils.LOG_WARNING(itemstack.getDisplayName() + " is not a valid Tool."); + Logger.WARNING(itemstack.getDisplayName() + " is not a valid Tool."); return false; } diff --git a/src/Java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java b/src/Java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java index 4716701e16..85de0df60e 100644 --- a/src/Java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java +++ b/src/Java/gtPlusPlus/core/slots/SlotModularBaubleUpgrades.java @@ -6,7 +6,7 @@ import static gtPlusPlus.core.tileentities.machines.TileEntityModularityTable.mV import java.util.Iterator; import java.util.Map.Entry; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.array.Pair; import gtPlusPlus.core.util.nbt.ModularArmourUtils.BT; import gtPlusPlus.core.util.nbt.ModularArmourUtils.Modifiers; @@ -25,8 +25,8 @@ public class SlotModularBaubleUpgrades extends Slot { public boolean isItemValid(final ItemStack itemstack) { boolean isValid = false; if (itemstack != null) { - Utils.LOG_INFO("trying to insert " + itemstack.getDisplayName()); - Utils.LOG_INFO("Valid Upgrade count: " + mValidUpgradeList.size()); + Logger.INFO("trying to insert " + itemstack.getDisplayName()); + Logger.INFO("Valid Upgrade count: " + mValidUpgradeList.size()); Iterator<Entry<ItemStack, BT>> it = mValidUpgradeListFormChange.entrySet().iterator(); while (it.hasNext()) { |