diff --git a/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java b/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java index e279fecf..4f6fc11b 100644 --- a/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java +++ b/src/main/java/team/chisel/block/tileentity/TileEntityAutoChisel.java @@ -2,15 +2,6 @@ package team.chisel.block.tileentity; import java.util.List; -import com.cricketcraft.chisel.api.IChiselItem; - -import team.chisel.carving.Carving; -import team.chisel.client.GeneralChiselClient; -import team.chisel.init.ChiselItems; -import team.chisel.network.PacketHandler; -import team.chisel.network.message.MessageAutoChisel; -import team.chisel.network.message.MessageSlotUpdate; -import team.chisel.utils.General; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -21,7 +12,19 @@ import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import team.chisel.Features; +import team.chisel.carving.Carving; +import team.chisel.client.GeneralChiselClient; +import team.chisel.init.ChiselItems; +import team.chisel.network.PacketHandler; +import team.chisel.network.message.MessageAutoChisel; +import team.chisel.network.message.MessageSlotUpdate; +import team.chisel.utils.General; + +import com.cricketcraft.chisel.api.IChiselItem; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -34,11 +37,18 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory REVERSION; public String getUnlocalizedName() { - return ChiselItems.upgrade.getUnlocalizedName() + "_" + this.name().toLowerCase(); + if (Features.AUTO_CHISEL_UPGRADES.enabled()) { + return ChiselItems.upgrade.getUnlocalizedName() + "_" + this.name().toLowerCase() + ".name"; + } + return "chisel.autochisel.upgrade.disabled"; } public String getLocalizedName() { - return StatCollector.translateToLocal(getUnlocalizedName() + ".name"); + String ret = StatCollector.translateToLocal(getUnlocalizedName()); + if (!Features.AUTO_CHISEL_UPGRADES.enabled()) { + ret = EnumChatFormatting.RED.toString().concat(ret); + } + return ret; } } @@ -85,8 +95,9 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory inventory[slot] = null; return is; } - } else + } else { return null; + } } @Override @@ -351,7 +362,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory case CHISEL: return itemStack.getItem() instanceof IChiselItem; default: - return itemStack.getItem() == ChiselItems.upgrade && Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage(); + return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade && Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage(); } } @@ -413,11 +424,15 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory } public boolean hasUpgrade(Upgrade upgrade) { - ItemStack stack = inventory[MIN_UPGRADE + upgrade.ordinal()]; - if (stack != null) { - return stack.getItem() == ChiselItems.upgrade && stack.getItemDamage() == upgrade.ordinal(); + if (Features.AUTO_CHISEL_UPGRADES.enabled()) { + ItemStack stack = inventory[MIN_UPGRADE + upgrade.ordinal()]; + if (stack != null) { + return stack.getItem() == ChiselItems.upgrade && stack.getItemDamage() == upgrade.ordinal(); + } + return false; } - return false; + + return upgrade == Upgrade.REVERSION ? false : true; } public String getSlotTooltipUnloc(int slotNumber) { @@ -429,9 +444,10 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory } else if (slotNumber == CHISEL) { name = "chisel"; } - return name == null ? null : String.format(base, name); + String unloc = name == null ? null : String.format(base, name); + return StatCollector.translateToLocal(unloc); } else { - return Upgrade.values()[slotNumber - MIN_UPGRADE].getUnlocalizedName() + ".name"; + return Upgrade.values()[slotNumber - MIN_UPGRADE].getLocalizedName(); } } diff --git a/src/main/java/team/chisel/client/gui/GuiAutoChisel.java b/src/main/java/team/chisel/client/gui/GuiAutoChisel.java index c18d778e..020ceb26 100644 --- a/src/main/java/team/chisel/client/gui/GuiAutoChisel.java +++ b/src/main/java/team/chisel/client/gui/GuiAutoChisel.java @@ -7,7 +7,6 @@ import net.minecraft.client.renderer.RenderHelper; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; @@ -28,10 +27,15 @@ public class GuiAutoChisel extends GuiContainer { autochisel = tileEntityAutoChisel; } - @SuppressWarnings("unchecked") @Override protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); + } + + @SuppressWarnings("unchecked") + @Override + public void drawScreen(int mouseX, int mouseY, float partialTick) { + super.drawScreen(mouseX, mouseY, partialTick); int x = (this.width - this.xSize) / 2; int y = (this.height - this.ySize) / 2; @@ -41,7 +45,7 @@ public class GuiAutoChisel extends GuiContainer { if (slot.slotNumber < autochisel.getSizeInventory()) { String tt = autochisel.getSlotTooltipUnloc(slot.slotNumber); if (!Strings.isNullOrEmpty(tt)) { - this.func_146283_a(Lists.newArrayList(StatCollector.translateToLocal(tt)), mouseX - x, mouseY - y); + this.func_146283_a(Lists.newArrayList(tt), mouseX, mouseY); } } } diff --git a/src/main/resources/assets/chisel/lang/en_US.lang b/src/main/resources/assets/chisel/lang/en_US.lang index d8118168..865be700 100644 --- a/src/main/resources/assets/chisel/lang/en_US.lang +++ b/src/main/resources/assets/chisel/lang/en_US.lang @@ -117,6 +117,7 @@ autochisel.slot.speed.tooltip=Speed Upgrade autochisel.slot.automation.tooltip=Automation Upgrade autochisel.slot.stack.tooltip=Stack Upgrade autochisel.slot.reversion.tooltip=Reversion Upgrade +chisel.autochisel.upgrade.disabled=Upgrades Disabled #Beacon tile.chisel.beacon.name=Beacon diff --git a/src/main/resources/assets/chisel/textures/blocks/futura/Base/screenCyan-ctm.png.mcmeta b/src/main/resources/assets/chisel/textures/blocks/futura/Base/screenCyan-ctm.png.mcmeta deleted file mode 100644 index c82b1666..00000000 --- a/src/main/resources/assets/chisel/textures/blocks/futura/Base/screenCyan-ctm.png.mcmeta +++ /dev/null @@ -1,23 +0,0 @@ -{ - "animation": { - "frametime": 1, - "frames": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/chisel/textures/blocks/futura/Base/screenMetallic-ctm.png.mcmeta b/src/main/resources/assets/chisel/textures/blocks/futura/Base/screenMetallic-ctm.png.mcmeta deleted file mode 100644 index c82b1666..00000000 --- a/src/main/resources/assets/chisel/textures/blocks/futura/Base/screenMetallic-ctm.png.mcmeta +++ /dev/null @@ -1,23 +0,0 @@ -{ - "animation": { - "frametime": 1, - "frames": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/chisel/textures/blocks/futura/Base/wavy.png.mcmeta b/src/main/resources/assets/chisel/textures/blocks/futura/Base/wavy.png.mcmeta deleted file mode 100644 index f0139e77..00000000 --- a/src/main/resources/assets/chisel/textures/blocks/futura/Base/wavy.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} \ No newline at end of file diff --git a/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/screenCyan-ctm.png.mcmeta b/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/screenCyan-ctm.png.mcmeta deleted file mode 100644 index c82b1666..00000000 --- a/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/screenCyan-ctm.png.mcmeta +++ /dev/null @@ -1,23 +0,0 @@ -{ - "animation": { - "frametime": 1, - "frames": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/screenMetallic-ctm.png.mcmeta b/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/screenMetallic-ctm.png.mcmeta deleted file mode 100644 index c82b1666..00000000 --- a/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/screenMetallic-ctm.png.mcmeta +++ /dev/null @@ -1,23 +0,0 @@ -{ - "animation": { - "frametime": 1, - "frames": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - ] - } -} \ No newline at end of file diff --git a/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/wavy.png.mcmeta b/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/wavy.png.mcmeta deleted file mode 100644 index f0139e77..00000000 --- a/src/main/resources/assets/chisel/textures/blocks/futura/Overlay/wavy.png.mcmeta +++ /dev/null @@ -1,3 +0,0 @@ -{ - "animation": {} -} \ No newline at end of file