From b88fe49ee21b90ae7eeb18745a8d737d146b57a2 Mon Sep 17 00:00:00 2001 From: Modmuss50 Date: Mon, 23 Nov 2015 18:41:29 +0000 Subject: [PATCH] 1936 --- .../techreborn/client/ClientMultiBlocks.java | 6 +- .../java/techreborn/client/GuiHandler.java | 105 ++++----- .../java/techreborn/client/IconSupplier.java | 70 +++--- .../techreborn/client/StackToolTipEvent.java | 2 +- .../client/VersionCheckerClient.java | 4 +- .../client/container/ContainerAesu.java | 4 +- .../container/ContainerAlloyFurnace.java | 4 +- .../client/container/ContainerCrafting.java | 4 +- .../container/ContainerDestructoPack.java | 2 +- .../container/ContainerDieselGenerator.java | 4 +- .../container/ContainerFusionReactor.java | 4 +- .../client/container/ContainerIDSU.java | 4 +- .../client/container/ContainerLesu.java | 4 +- .../container/ContainerMatterFabricator.java | 4 +- .../container/ContainerRollingMachine.java | 4 +- .../java/techreborn/client/gui/GuiAesu.java | 3 +- .../client/gui/GuiBlastFurnace.java | 10 +- .../client/gui/GuiFusionReactor.java | 10 +- .../techreborn/client/gui/GuiGrinder.java | 43 ++-- .../java/techreborn/client/gui/GuiIDSU.java | 3 +- .../client/gui/GuiImplosionCompressor.java | 3 +- .../client/gui/GuiIndustrialSawmill.java | 37 ++- .../client/gui/GuiVacuumFreezer.java | 10 +- .../java/techreborn/client/hud/ChargeHud.java | 15 +- .../client/render/RenderCablePart.java | 213 +++++++++--------- .../CasingConnectedTextureGenerator.java | 35 ++- .../LesuConnectedTextureGenerator.java | 34 +-- src/main/java/techreborn/items/ItemParts.java | 41 +--- src/main/java/techreborn/pda/GuiManual.java | 6 +- .../java/techreborn/pda/PageCollection.java | 11 +- .../techreborn/tiles/TileMachineBase.java | 2 + .../TileEntityFusionController.java | 58 +++-- .../java/techreborn/tiles/idsu/TileIDSU.java | 2 +- .../java/techreborn/tiles/lesu/TileLesu.java | 11 +- .../tiles/lesu/TileLesuStorage.java | 9 +- src/main/java/techreborn/world/TROreGen.java | 43 ++-- 36 files changed, 407 insertions(+), 417 deletions(-) diff --git a/src/main/java/techreborn/client/ClientMultiBlocks.java b/src/main/java/techreborn/client/ClientMultiBlocks.java index 6facf13a0..9dcf21402 100644 --- a/src/main/java/techreborn/client/ClientMultiBlocks.java +++ b/src/main/java/techreborn/client/ClientMultiBlocks.java @@ -53,9 +53,9 @@ public class ClientMultiBlocks { } public static void checkMachine() { - int xDir = EnumFacing.UP.offsetX * 2; - int yDir = EnumFacing.UP.offsetY * 2; - int zDir = EnumFacing.UP.offsetZ * 2; + int xDir = EnumFacing.UP.getFrontOffsetX() * 2; + int yDir = EnumFacing.UP.getFrontOffsetY() * 2; + int zDir = EnumFacing.UP.getFrontOffsetZ() * 2; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { for (int k = -1; k < 2; k++) { diff --git a/src/main/java/techreborn/client/GuiHandler.java b/src/main/java/techreborn/client/GuiHandler.java index 6b91c4edb..b676596d0 100644 --- a/src/main/java/techreborn/client/GuiHandler.java +++ b/src/main/java/techreborn/client/GuiHandler.java @@ -1,5 +1,6 @@ package techreborn.client; +import net.minecraft.util.BlockPos; import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; @@ -47,81 +48,81 @@ public class GuiHandler implements IGuiHandler { int x, int y, int z) { if (ID == thermalGeneratorID) { return new ContainerThermalGenerator( - (TileThermalGenerator) world.getTileEntity(x, y, z), player); + (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == semifluidGeneratorID) { return new ContainerSemifluidGenerator( - (TileSemifluidGenerator) world.getTileEntity(x, y, z), player); + (TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == gasTurbineID) { return new ContainerGasTurbine( - (TileGasTurbine) world.getTileEntity(x, y, z), player); + (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == quantumTankID) { return new ContainerQuantumTank( - (TileQuantumTank) world.getTileEntity(x, y, z), player); + (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == digitalChestID) { return new ContainerDigitalChest( - (TileDigitalChest) world.getTileEntity(x, y, z), player); + (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == quantumChestID) { return new ContainerQuantumChest( - (TileQuantumChest) world.getTileEntity(x, y, z), player); + (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == centrifugeID) { return new ContainerCentrifuge( - (TileCentrifuge) world.getTileEntity(x, y, z), player); + (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == rollingMachineID) { return new ContainerRollingMachine( - (TileRollingMachine) world.getTileEntity(x, y, z), player); + (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == blastFurnaceID) { return new ContainerBlastFurnace( - (TileBlastFurnace) world.getTileEntity(x, y, z), player); + (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == alloySmelterID) { return new ContainerAlloySmelter( - (TileAlloySmelter) world.getTileEntity(x, y, z), player); + (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == grinderID) { return new ContainerGrinder( - (TileGrinder) world.getTileEntity(x, y, z), player); + (TileGrinder) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == compresserID) { return new ContainerImplosionCompressor( - (TileImplosionCompressor) world.getTileEntity(x, y, z), player); + (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == matterfabID) { return new ContainerMatterFabricator( - (TileMatterFabricator) world.getTileEntity(x, y, z), player); + (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == chunkloaderID) { return new ContainerChunkloader( - (TileChunkLoader) world.getTileEntity(x, y, z), player); + (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == assemblingmachineID) { return new ContainerAssemblingMachine( - (TileAssemblingMachine) world.getTileEntity(x, y, z), player); + (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == dieselGeneratorID) { return new ContainerDieselGenerator( - (TileDieselGenerator) world.getTileEntity(x, y, z), player); + (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == industrialElectrolyzerID) { return new ContainerIndustrialElectrolyzer( - (TileIndustrialElectrolyzer) world.getTileEntity(x, y, z), player); + (TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == aesuID) { return new ContainerAesu( - (TileAesu) world.getTileEntity(x, y, z), player); + (TileAesu) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == alloyFurnaceID) { return new ContainerAlloyFurnace( - (TileAlloyFurnace) world.getTileEntity(x, y, z), player); + (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == sawMillID) { return new ContainerIndustrialSawmill( - (TileIndustrialSawmill) world.getTileEntity(x, y, z), player); + (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == chemicalReactorID) { return new ContainerChemicalReactor( - (TileChemicalReactor) world.getTileEntity(x, y, z), player); + (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == pdaID) { return null; } else if (ID == destructoPackID) { return new ContainerDestructoPack(player); } else if (ID == lesuID) { - return new ContainerLesu((TileLesu) world.getTileEntity(x, y, z), player); + return new ContainerLesu((TileLesu) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == idsuID) { - return new ContainerIDSU((TileIDSU) world.getTileEntity(x, y, z), player); + return new ContainerIDSU((TileIDSU) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == chargeBench) { - return new ContainerChargeBench((TileChargeBench) world.getTileEntity(x, y, z), player); + return new ContainerChargeBench((TileChargeBench) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == fusionID) { - return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(x, y, z), player); + return new ContainerFusionReactor((TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z)), player); }else if (ID == vacuumFreezerID) { - return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(x, y, z), player); + return new ContainerVacuumFreezer((TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z)), player); } @@ -133,81 +134,81 @@ public class GuiHandler implements IGuiHandler { int x, int y, int z) { if (ID == thermalGeneratorID) { return new GuiThermalGenerator(player, - (TileThermalGenerator) world.getTileEntity(x, y, z)); + (TileThermalGenerator) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == semifluidGeneratorID) { return new GuiSemifluidGenerator(player, - (TileSemifluidGenerator) world.getTileEntity(x, y, z)); + (TileSemifluidGenerator) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == gasTurbineID) { return new GuiGasTurbine(player, - (TileGasTurbine) world.getTileEntity(x, y, z)); + (TileGasTurbine) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == quantumTankID) { return new GuiQuantumTank(player, - (TileQuantumTank) world.getTileEntity(x, y, z)); + (TileQuantumTank) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == digitalChestID) { return new GuiDigitalChest(player, - (TileDigitalChest) world.getTileEntity(x, y, z)); + (TileDigitalChest) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == quantumChestID) { return new GuiQuantumChest(player, - (TileQuantumChest) world.getTileEntity(x, y, z)); + (TileQuantumChest) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == centrifugeID) { return new GuiCentrifuge(player, - (TileCentrifuge) world.getTileEntity(x, y, z)); + (TileCentrifuge) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == rollingMachineID) { return new GuiRollingMachine(player, - (TileRollingMachine) world.getTileEntity(x, y, z)); + (TileRollingMachine) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == blastFurnaceID) { return new GuiBlastFurnace(player, - (TileBlastFurnace) world.getTileEntity(x, y, z)); + (TileBlastFurnace) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == alloySmelterID) { return new GuiAlloySmelter(player, - (TileAlloySmelter) world.getTileEntity(x, y, z)); + (TileAlloySmelter) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == grinderID) { return new GuiGrinder(player, - (TileGrinder) world.getTileEntity(x, y, z)); + (TileGrinder) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == compresserID) { return new GuiImplosionCompressor(player, - (TileImplosionCompressor) world.getTileEntity(x, y, z)); + (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == matterfabID) { return new GuiMatterFabricator(player, - (TileMatterFabricator) world.getTileEntity(x, y, z)); + (TileMatterFabricator) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == chunkloaderID) { return new GuiChunkLoader(player, - (TileChunkLoader) world.getTileEntity(x, y, z)); + (TileChunkLoader) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == assemblingmachineID) { return new GuiAssemblingMachine(player, - (TileAssemblingMachine) world.getTileEntity(x, y, z)); + (TileAssemblingMachine) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == dieselGeneratorID) { return new GuiDieselGenerator(player, - (TileDieselGenerator) world.getTileEntity(x, y, z)); + (TileDieselGenerator) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == industrialElectrolyzerID) { return new GuiIndustrialElectrolyzer(player, - (TileIndustrialElectrolyzer) world.getTileEntity(x, y, z)); + (TileIndustrialElectrolyzer) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == aesuID) { return new GuiAesu(player, - (TileAesu) world.getTileEntity(x, y, z)); + (TileAesu) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == alloyFurnaceID) { return new GuiAlloyFurnace(player, - (TileAlloyFurnace) world.getTileEntity(x, y, z)); + (TileAlloyFurnace) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == sawMillID) { return new GuiIndustrialSawmill(player, - (TileIndustrialSawmill) world.getTileEntity(x, y, z)); + (TileIndustrialSawmill) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == chemicalReactorID) { return new GuiChemicalReactor(player, - (TileChemicalReactor) world.getTileEntity(x, y, z)); + (TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == pdaID) { return new GuiManual(); } else if (ID == destructoPackID) { return new GuiDestructoPack(new ContainerDestructoPack(player)); } else if (ID == lesuID) { - return new GuiLesu(player, (TileLesu) world.getTileEntity(x, y, z)); + return new GuiLesu(player, (TileLesu) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == idsuID) { - return new GuiIDSU(player, (TileIDSU) world.getTileEntity(x, y, z)); + return new GuiIDSU(player, (TileIDSU) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == chargeBench) { - return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(x, y, z)); + return new GuiChargeBench(player, (TileChargeBench) world.getTileEntity(new BlockPos(x, y, z))); }else if (ID == fusionID) { - return new GuiFusionReactor(player, (TileEntityFusionController) world.getTileEntity(x, y, z)); + return new GuiFusionReactor(player, (TileEntityFusionController) world.getTileEntity(new BlockPos(x, y, z))); }else if (ID == vacuumFreezerID) { - return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(x, y, z)); + return new GuiVacuumFreezer(player, (TileVacuumFreezer) world.getTileEntity(new BlockPos(x, y, z))); } return null; } diff --git a/src/main/java/techreborn/client/IconSupplier.java b/src/main/java/techreborn/client/IconSupplier.java index 7e6bd1667..d7d4dce33 100644 --- a/src/main/java/techreborn/client/IconSupplier.java +++ b/src/main/java/techreborn/client/IconSupplier.java @@ -2,43 +2,43 @@ package techreborn.client; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.util.IIcon; import net.minecraftforge.client.event.TextureStitchEvent; +//TODO recode for 1.8 public class IconSupplier { - public static IIcon insulatedCopperCable; - public static IIcon copperCable; - public static IIcon goldCable; - public static IIcon insulatedGoldCable; - public static IIcon doubleInsulatedGoldCable; - public static IIcon ironCable; - public static IIcon insulatedIronCable; - public static IIcon doubleInsulatedIronCable; - public static IIcon trippleInsulatedIronCable; - public static IIcon glassFiberCable; - public static IIcon tinCable; - public static IIcon detectorCableBlock; - public static IIcon splitterCableBlock; - public static IIcon insulatedtinCableBlock; +// public static IIcon insulatedCopperCable; +// public static IIcon copperCable; +// public static IIcon goldCable; +// public static IIcon insulatedGoldCable; +// public static IIcon doubleInsulatedGoldCable; +// public static IIcon ironCable; +// public static IIcon insulatedIronCable; +// public static IIcon doubleInsulatedIronCable; +// public static IIcon trippleInsulatedIronCable; +// public static IIcon glassFiberCable; +// public static IIcon tinCable; +// public static IIcon detectorCableBlock; +// public static IIcon splitterCableBlock; +// public static IIcon insulatedtinCableBlock; - @SubscribeEvent - public void onTextureStitch(TextureStitchEvent.Pre event) { - TextureMap reg = event.map; - if (reg.getTextureType() == 0) { - insulatedCopperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCable"); - copperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCableO"); - goldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCable"); - insulatedGoldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCableI"); - doubleInsulatedGoldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCableII"); - ironCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCable"); - insulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableI"); - doubleInsulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableII"); - trippleInsulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableIII"); - glassFiberCable = reg.registerIcon("ic2" + ":wiring/cable/blockGlassCable"); - tinCable = reg.registerIcon("ic2" + ":wiring/cable/blockTinCable"); - detectorCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockDetectorCable"); - splitterCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockSplitterCable"); - insulatedtinCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockTinCableI"); - } - } +// @SubscribeEvent +// public void onTextureStitch(TextureStitchEvent.Pre event) { +// TextureMap reg = event.map; +// if (reg.getTextureType() == 0) { +// insulatedCopperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCable"); +// copperCable = reg.registerIcon("ic2" + ":wiring/cable/blockCableO"); +// goldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCable"); +// insulatedGoldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCableI"); +// doubleInsulatedGoldCable = reg.registerIcon("ic2" + ":wiring/cable/blockGoldCableII"); +// ironCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCable"); +// insulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableI"); +// doubleInsulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableII"); +// trippleInsulatedIronCable = reg.registerIcon("ic2" + ":wiring/cable/blockIronCableIII"); +// glassFiberCable = reg.registerIcon("ic2" + ":wiring/cable/blockGlassCable"); +// tinCable = reg.registerIcon("ic2" + ":wiring/cable/blockTinCable"); +// detectorCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockDetectorCable"); +// splitterCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockSplitterCable"); +// insulatedtinCableBlock = reg.registerIcon("ic2" + ":wiring/cable/blockTinCableI"); +// } +// } } diff --git a/src/main/java/techreborn/client/StackToolTipEvent.java b/src/main/java/techreborn/client/StackToolTipEvent.java index 1a20dbf23..42b02bfa6 100644 --- a/src/main/java/techreborn/client/StackToolTipEvent.java +++ b/src/main/java/techreborn/client/StackToolTipEvent.java @@ -39,7 +39,7 @@ public class StackToolTipEvent { try{ Block block = Block.getBlockFromItem(event.itemStack.getItem()); if (block != null && block instanceof BlockContainer && block.getClass().getCanonicalName().startsWith("techreborn.")) { - TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld, event.itemStack.getItemDamage()); + TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().theWorld, block.getDefaultState()); if (tile instanceof IListInfoProvider) { ((IListInfoProvider) tile).addInfo(event.toolTip, false); } diff --git a/src/main/java/techreborn/client/VersionCheckerClient.java b/src/main/java/techreborn/client/VersionCheckerClient.java index 04a243ddc..3afb59d5b 100644 --- a/src/main/java/techreborn/client/VersionCheckerClient.java +++ b/src/main/java/techreborn/client/VersionCheckerClient.java @@ -29,13 +29,13 @@ public class VersionCheckerClient { } else { s = "There is an update for TechReborn with " + changeLog.size() + " changes."; } - event.gui.drawString(event.gui.mc.fontRenderer, s, 10, 5, Color.white.getRGB()); + event.gui.drawString(event.gui.mc.fontRendererObj, s, 10, 5, Color.white.getRGB()); if (!Core.INSTANCE.versionChecker.isLatestVersion()) { if (event.mouseY < 20) { GuiUtil.drawTooltipBox(5, 15, 330, changeLog.size() * 10 + 5); int y = 20; for (String change : changeLog) { - event.gui.drawString(event.gui.mc.fontRenderer, change, 10, y, Color.white.getRGB()); + event.gui.drawString(event.gui.mc.fontRendererObj, change, 10, y, Color.white.getRGB()); y += 10; } } diff --git a/src/main/java/techreborn/client/container/ContainerAesu.java b/src/main/java/techreborn/client/container/ContainerAesu.java index a087c6f86..74a1472c5 100644 --- a/src/main/java/techreborn/client/container/ContainerAesu.java +++ b/src/main/java/techreborn/client/container/ContainerAesu.java @@ -65,8 +65,8 @@ public class ContainerAesu extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput()); crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); diff --git a/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java b/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java index ccbaa4e64..cd0fb88a3 100644 --- a/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java +++ b/src/main/java/techreborn/client/container/ContainerAlloyFurnace.java @@ -53,8 +53,8 @@ public class ContainerAlloyFurnace extends RebornContainer { int cookTime; @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, tile.currentItemBurnTime); crafting.sendProgressBarUpdate(this, 1, tile.burnTime); crafting.sendProgressBarUpdate(this, 2, tile.cookTime); diff --git a/src/main/java/techreborn/client/container/ContainerCrafting.java b/src/main/java/techreborn/client/container/ContainerCrafting.java index 9266c920d..5afe42cc0 100644 --- a/src/main/java/techreborn/client/container/ContainerCrafting.java +++ b/src/main/java/techreborn/client/container/ContainerCrafting.java @@ -36,8 +36,8 @@ public abstract class ContainerCrafting extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, crafter.currentTickTime); crafting.sendProgressBarUpdate(this, 1, crafter.currentNeededTicks); crafting.sendProgressBarUpdate(this, 2, (int) crafter.energy.getEnergy()); diff --git a/src/main/java/techreborn/client/container/ContainerDestructoPack.java b/src/main/java/techreborn/client/container/ContainerDestructoPack.java index 7c8bce02f..093e4a8e0 100644 --- a/src/main/java/techreborn/client/container/ContainerDestructoPack.java +++ b/src/main/java/techreborn/client/container/ContainerDestructoPack.java @@ -15,7 +15,7 @@ public class ContainerDestructoPack extends RebornContainer { public ContainerDestructoPack(EntityPlayer player) { this.player = player; - inv = new Inventory(1, "destructopack", 64); + inv = new Inventory(1, "destructopack", 64, null); buildContainer(); } diff --git a/src/main/java/techreborn/client/container/ContainerDieselGenerator.java b/src/main/java/techreborn/client/container/ContainerDieselGenerator.java index 5dd6b5efe..3f94d0e9c 100644 --- a/src/main/java/techreborn/client/container/ContainerDieselGenerator.java +++ b/src/main/java/techreborn/client/container/ContainerDieselGenerator.java @@ -64,8 +64,8 @@ public class ContainerDieselGenerator extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, (int) tiledieselGenerator.getEnergy()); crafting.sendProgressBarUpdate(this, 1, tiledieselGenerator.tank.getFluidAmount()); } diff --git a/src/main/java/techreborn/client/container/ContainerFusionReactor.java b/src/main/java/techreborn/client/container/ContainerFusionReactor.java index 947579807..fd004a949 100644 --- a/src/main/java/techreborn/client/container/ContainerFusionReactor.java +++ b/src/main/java/techreborn/client/container/ContainerFusionReactor.java @@ -74,8 +74,8 @@ public class ContainerFusionReactor extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, fusionController.coilStatus); crafting.sendProgressBarUpdate(this, 1, (int) fusionController.getEnergy()); crafting.sendProgressBarUpdate(this, 2, fusionController.crafingTickTime); diff --git a/src/main/java/techreborn/client/container/ContainerIDSU.java b/src/main/java/techreborn/client/container/ContainerIDSU.java index cde14e003..8b949d74a 100644 --- a/src/main/java/techreborn/client/container/ContainerIDSU.java +++ b/src/main/java/techreborn/client/container/ContainerIDSU.java @@ -63,8 +63,8 @@ public class ContainerIDSU extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, tile.output); crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); diff --git a/src/main/java/techreborn/client/container/ContainerLesu.java b/src/main/java/techreborn/client/container/ContainerLesu.java index 7b20878b3..bc64ca798 100644 --- a/src/main/java/techreborn/client/container/ContainerLesu.java +++ b/src/main/java/techreborn/client/container/ContainerLesu.java @@ -71,8 +71,8 @@ public class ContainerLesu extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, (int) tile.getMaxOutput()); crafting.sendProgressBarUpdate(this, 1, (int) tile.getEnergy()); crafting.sendProgressBarUpdate(this, 2, (int) tile.getEuChange()); diff --git a/src/main/java/techreborn/client/container/ContainerMatterFabricator.java b/src/main/java/techreborn/client/container/ContainerMatterFabricator.java index 6d7e3763c..7423b8558 100644 --- a/src/main/java/techreborn/client/container/ContainerMatterFabricator.java +++ b/src/main/java/techreborn/client/container/ContainerMatterFabricator.java @@ -66,8 +66,8 @@ public class ContainerMatterFabricator extends RebornContainer { } @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, tile.progresstime); } diff --git a/src/main/java/techreborn/client/container/ContainerRollingMachine.java b/src/main/java/techreborn/client/container/ContainerRollingMachine.java index 0fe94c25f..3bebe0042 100644 --- a/src/main/java/techreborn/client/container/ContainerRollingMachine.java +++ b/src/main/java/techreborn/client/container/ContainerRollingMachine.java @@ -65,8 +65,8 @@ public class ContainerRollingMachine extends RebornContainer { int energy; @Override - public void addCraftingToCrafters(ICrafting crafting) { - super.addCraftingToCrafters(crafting); + public void onCraftGuiOpened(ICrafting crafting) { + super.onCraftGuiOpened(crafting); crafting.sendProgressBarUpdate(this, 0, tile.runTime); crafting.sendProgressBarUpdate(this, 1, tile.tickTime); crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy()); diff --git a/src/main/java/techreborn/client/gui/GuiAesu.java b/src/main/java/techreborn/client/gui/GuiAesu.java index adfceeb46..6b735d661 100644 --- a/src/main/java/techreborn/client/gui/GuiAesu.java +++ b/src/main/java/techreborn/client/gui/GuiAesu.java @@ -11,6 +11,7 @@ import techreborn.packets.PacketAesu; import techreborn.tiles.TileAesu; import java.awt.*; +import java.io.IOException; public class GuiAesu extends GuiContainer { @@ -60,7 +61,7 @@ public class GuiAesu extends GuiContainer { } @Override - protected void actionPerformed(GuiButton button) { + protected void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); PacketHandler.sendPacketToServer(new PacketAesu(button.id, aesu)); } diff --git a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java index b8799272c..c7ba6fcb8 100644 --- a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java @@ -4,7 +4,6 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.util.EnumFacing; @@ -12,11 +11,14 @@ import reborncore.client.gui.GuiUtil; import reborncore.client.multiblock.Multiblock; import reborncore.client.multiblock.MultiblockSet; import reborncore.common.misc.Location; +import reborncore.common.multiblock.CoordTriplet; import techreborn.client.container.ContainerBlastFurnace; import techreborn.init.ModBlocks; import techreborn.proxies.ClientProxy; import techreborn.tiles.TileBlastFurnace; +import java.io.IOException; + public class GuiBlastFurnace extends GuiContainer { @@ -41,7 +43,7 @@ public class GuiBlastFurnace extends GuiContainer { GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, ""); buttonList.add(button); super.initGui(); - ChunkCoordinates coordinates = new ChunkCoordinates(blastfurnace.getPos().getX() - (EnumFacing.getOrientation(blastfurnace.getRotation()).offsetX * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getOrientation(blastfurnace.getRotation()).offsetZ * 2)); + CoordTriplet coordinates = new CoordTriplet(blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getRotation()).getFrontOffsetX() * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getFront(blastfurnace.getRotation()).getFrontOffsetZ() * 2)); if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor) && blastfurnace.getHeat() != 0){ ClientProxy.multiblockRenderEvent.setMultiblock(null); button.displayString = "B"; @@ -87,7 +89,7 @@ public class GuiBlastFurnace extends GuiContainer { } @Override - public void actionPerformed(GuiButton button) { + public void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); if(button.id == 212){ if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ @@ -134,7 +136,7 @@ public class GuiBlastFurnace extends GuiContainer { MultiblockSet set = new MultiblockSet(multiblock); ClientProxy.multiblockRenderEvent.setMultiblock(set); ClientProxy.multiblockRenderEvent.partent = new Location(blastfurnace.getPos().getX(), blastfurnace.getPos().getY(), blastfurnace.getPos().getZ(), blastfurnace.getWorld()); - ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(blastfurnace.getPos().getX() - (EnumFacing.getOrientation(blastfurnace.getRotation()).offsetX * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getOrientation(blastfurnace.getRotation()).offsetZ * 2)); + ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(blastfurnace.getPos().getX() - (EnumFacing.getFront(blastfurnace.getRotation()).getFrontOffsetX() * 2), blastfurnace.getPos().getY() - 1, blastfurnace.getPos().getZ() - (EnumFacing.getFront(blastfurnace.getRotation()).getFrontOffsetZ() * 2)); } button.displayString = "A"; } else { diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index 35a4515a6..e9eedd7bc 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -4,19 +4,21 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.util.EnumFacing; import reborncore.client.multiblock.Multiblock; import reborncore.client.multiblock.MultiblockSet; import reborncore.common.misc.Location; +import reborncore.common.multiblock.CoordTriplet; import techreborn.client.ClientMultiBlocks; import techreborn.client.container.ContainerFusionReactor; import techreborn.init.ModBlocks; import techreborn.proxies.ClientProxy; import techreborn.tiles.fusionReactor.TileEntityFusionController; +import java.io.IOException; + public class GuiFusionReactor extends GuiContainer { @@ -51,7 +53,7 @@ public class GuiFusionReactor extends GuiContainer { GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, ""); buttonList.add(button); super.initGui(); - ChunkCoordinates coordinates = new ChunkCoordinates(fusionController.getPos().getX() - (EnumFacing.getOrientation(fusionController.getRotation()).offsetX * 2), fusionController.getPos().getY() - 1, fusionController.getPos().getZ() - (EnumFacing.getOrientation(fusionController.getRotation()).offsetZ * 2)); + CoordTriplet coordinates = new CoordTriplet(fusionController.getPos().getX() - (EnumFacing.getFront(fusionController.getRotation()).getFrontOffsetX() * 2), fusionController.getPos().getY() - 1, fusionController.getPos().getZ() - (EnumFacing.getFront(fusionController.getRotation()).getFrontOffsetZ() * 2)); if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){ ClientProxy.multiblockRenderEvent.setMultiblock(null); button.displayString = "B"; @@ -81,7 +83,7 @@ public class GuiFusionReactor extends GuiContainer { } @Override - public void actionPerformed(GuiButton button) { + public void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); if(button.id == 212){ if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ @@ -89,7 +91,7 @@ public class GuiFusionReactor extends GuiContainer { MultiblockSet set = new MultiblockSet(ClientMultiBlocks.reactor); ClientProxy.multiblockRenderEvent.setMultiblock(set); ClientProxy.multiblockRenderEvent.partent = new Location(fusionController.getPos().getX(), fusionController.getPos().getY(), fusionController.getPos().getZ(), fusionController.getWorld()); - ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(fusionController.getPos().getX() , fusionController.getPos().getY() -1 , fusionController.getPos().getZ()); + ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(fusionController.getPos().getX() , fusionController.getPos().getY() -1 , fusionController.getPos().getZ()); } button.displayString = "A"; } else { diff --git a/src/main/java/techreborn/client/gui/GuiGrinder.java b/src/main/java/techreborn/client/gui/GuiGrinder.java index ae15a9b03..7f2c0ded6 100644 --- a/src/main/java/techreborn/client/gui/GuiGrinder.java +++ b/src/main/java/techreborn/client/gui/GuiGrinder.java @@ -1,14 +1,10 @@ package techreborn.client.gui; -import codechicken.lib.gui.GuiDraw; import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import reborncore.client.gui.GuiUtil; import techreborn.client.container.ContainerGrinder; import techreborn.tiles.TileGrinder; @@ -45,28 +41,29 @@ public class GuiGrinder extends GuiContainer { } if (grinder.getMutliBlock() != true) { - GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10); + // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - j, 114, 10); this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - j, -1); } - if (grinder.tank.getFluidAmount() != 0) { - IIcon fluidIcon = grinder.tank.getFluid().getFluid().getIcon(); - if (fluidIcon != null) { - this.mc.renderEngine.bindTexture(texture); - drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); - - this.mc.renderEngine - .bindTexture(TextureMap.locationBlocksTexture); - int liquidHeight = grinder.tank.getFluidAmount() * 47 - / grinder.tank.getCapacity(); - GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 - - liquidHeight, 12.0D, liquidHeight, this.zLevel); - - this.mc.renderEngine.bindTexture(texture); - - drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); - } - } + //TODO 1.8 nope +// if (grinder.tank.getFluidAmount() != 0) { +// IIcon fluidIcon = grinder.tank.getFluid().getFluid().getIcon(); +// if (fluidIcon != null) { +// this.mc.renderEngine.bindTexture(texture); +// drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); +// +// this.mc.renderEngine +// .bindTexture(TextureMap.locationBlocksTexture); +// int liquidHeight = grinder.tank.getFluidAmount() * 47 +// / grinder.tank.getCapacity(); +// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 +// - liquidHeight, 12.0D, liquidHeight, this.zLevel); +// +// this.mc.renderEngine.bindTexture(texture); +// +// drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); +// } +// } } protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { diff --git a/src/main/java/techreborn/client/gui/GuiIDSU.java b/src/main/java/techreborn/client/gui/GuiIDSU.java index a03f64678..e271bf031 100644 --- a/src/main/java/techreborn/client/gui/GuiIDSU.java +++ b/src/main/java/techreborn/client/gui/GuiIDSU.java @@ -11,6 +11,7 @@ import techreborn.packets.PacketIdsu; import techreborn.tiles.idsu.TileIDSU; import java.awt.*; +import java.io.IOException; public class GuiIDSU extends GuiContainer { @@ -62,7 +63,7 @@ public class GuiIDSU extends GuiContainer { } @Override - protected void actionPerformed(GuiButton button) { + protected void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu)); diff --git a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java index 7739d1a19..b2c6dca03 100644 --- a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java +++ b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java @@ -1,6 +1,5 @@ package techreborn.client.gui; -import codechicken.lib.gui.GuiDraw; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; @@ -39,7 +38,7 @@ public class GuiImplosionCompressor extends GuiContainer { this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); if (compresser.getMutliBlock() != true) { - GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); + // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); this.fontRendererObj.drawString(StatCollector.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12 - 0, -1); } diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java index b38ee8c50..3cced1430 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java @@ -4,7 +4,6 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import reborncore.client.gui.GuiUtil; @@ -53,24 +52,24 @@ public class GuiIndustrialSawmill extends GuiContainer { if (j > 0) { this.drawTexturedModalRect(k + 33, l + 65 + 12 - j, 176, 12 - j, 14, j + 2); } - - if (sawmill.tank.getFluidAmount() != 0) { - IIcon fluidIcon = sawmill.tank.getFluid().getFluid().getIcon(); - if (fluidIcon != null) { - this.mc.renderEngine.bindTexture(texture); - - - this.mc.renderEngine - .bindTexture(TextureMap.locationBlocksTexture); - int liquidHeight = sawmill.tank.getFluidAmount() * 47 - / sawmill.tank.getCapacity(); - GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 - - liquidHeight, 12.0D, liquidHeight, this.zLevel); - - this.mc.renderEngine.bindTexture(texture); - // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); - } - } + //TODO 1.8 +// if (sawmill.tank.getFluidAmount() != 0) { +// IIcon fluidIcon = sawmill.tank.getFluid().getFluid().getIcon(); +// if (fluidIcon != null) { +// this.mc.renderEngine.bindTexture(texture); +// +// +// this.mc.renderEngine +// .bindTexture(TextureMap.locationBlocksTexture); +// int liquidHeight = sawmill.tank.getFluidAmount() * 47 +// / sawmill.tank.getCapacity(); +// GuiUtil.drawRepeated(fluidIcon, k + 11, l + 19 + 47 +// - liquidHeight, 12.0D, liquidHeight, this.zLevel); +// +// this.mc.renderEngine.bindTexture(texture); +// // drawTexturedModalRect(k + 7, l + 15, 176, 31, 20, 55); +// } +// } drawTexturedModalRect(k + 11, l + 19, 176, 86, 12, 47); if (sawmill.getMutliBlock() != true) { GuiUtil.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); diff --git a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java index 6b684f7d9..8be67b736 100644 --- a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java +++ b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java @@ -4,18 +4,20 @@ import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.util.EnumFacing; import reborncore.client.gui.GuiUtil; import reborncore.client.multiblock.MultiblockSet; import reborncore.common.misc.Location; +import reborncore.common.multiblock.CoordTriplet; import techreborn.client.ClientMultiBlocks; import techreborn.client.container.ContainerVacuumFreezer; import techreborn.proxies.ClientProxy; import techreborn.tiles.TileVacuumFreezer; +import java.io.IOException; + public class GuiVacuumFreezer extends GuiContainer { private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/vacuum_freezer.png"); @@ -38,7 +40,7 @@ public class GuiVacuumFreezer extends GuiContainer { GuiButton button = new GuiButton(212, k + this.xSize - 24, l + 4, 20, 20, ""); buttonList.add(button); super.initGui(); - ChunkCoordinates coordinates = new ChunkCoordinates(crafter.getPos().getX(), crafter.getPos().getY() - 5, crafter.getPos().getZ()); + CoordTriplet coordinates = new CoordTriplet(crafter.getPos().getX(), crafter.getPos().getY() - 5, crafter.getPos().getZ()); if(coordinates.equals(ClientProxy.multiblockRenderEvent.anchor)){ ClientProxy.multiblockRenderEvent.setMultiblock(null); button.displayString = "B"; @@ -79,7 +81,7 @@ public class GuiVacuumFreezer extends GuiContainer { } @Override - public void actionPerformed(GuiButton button) { + public void actionPerformed(GuiButton button) throws IOException { super.actionPerformed(button); if(button.id == 212){ if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){ @@ -87,7 +89,7 @@ public class GuiVacuumFreezer extends GuiContainer { MultiblockSet set = new MultiblockSet(ClientMultiBlocks.frezzer); ClientProxy.multiblockRenderEvent.setMultiblock(set); ClientProxy.multiblockRenderEvent.partent = new Location(crafter.getPos().getX(), crafter.getPos().getY(), crafter.getPos().getZ(), crafter.getWorld()); - ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(crafter.getPos().getX() , crafter.getPos().getY() -5 , crafter.getPos().getZ()); + ClientProxy.multiblockRenderEvent.anchor = new CoordTriplet(crafter.getPos().getX() , crafter.getPos().getY() -5 , crafter.getPos().getZ()); } button.displayString = "A"; } else { diff --git a/src/main/java/techreborn/client/hud/ChargeHud.java b/src/main/java/techreborn/client/hud/ChargeHud.java index e55cf6d31..2f4894ca3 100644 --- a/src/main/java/techreborn/client/hud/ChargeHud.java +++ b/src/main/java/techreborn/client/hud/ChargeHud.java @@ -59,9 +59,9 @@ public class ChargeHud { RenderHelper.enableStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting(); //Render the stack - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, armorstack, 0, y - 5); - //Render Overlay - RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, armorstack, 0, y - 5); + // RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, armorstack, 0, y - 5); + //Render Overlay //TODO 1.8 rendering + // RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, armorstack, 0, y - 5); //Get the color depending on current charge if (CurrentCharge <= half) { color = Color.YELLOW; @@ -69,7 +69,7 @@ public class ChargeHud { if (CurrentCharge <= quarter) { color = Color.DARK_RED; } - mc.fontRenderer.drawString(color + GetEUString(CurrentCharge) + "/" + GetEUString(MaxCharge), 20, y, 0); + mc.fontRendererObj.drawString(color + GetEUString(CurrentCharge) + "/" + GetEUString(MaxCharge), 20, y, 0); y += 20; } @@ -84,15 +84,16 @@ public class ChargeHud { GL11.glEnable(32826); RenderHelper.enableStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting(); - RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, y - 5); - RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, y - 5); + //TODO 1.8 nope + //RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, y - 5); + // RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, stack, 0, y - 5); if (CurrentCharge <= half) { color = Color.YELLOW; } if (CurrentCharge <= quarter) { color = Color.DARK_RED; } - mc.fontRenderer.drawString(color + GetEUString(CurrentCharge) + "/" + GetEUString(MaxCharge), 20, y, 0); + mc.fontRendererObj.drawString(color + GetEUString(CurrentCharge) + "/" + GetEUString(MaxCharge), 20, y, 0); } } GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/src/main/java/techreborn/client/render/RenderCablePart.java b/src/main/java/techreborn/client/render/RenderCablePart.java index 942f248a4..3eb1aa6e5 100644 --- a/src/main/java/techreborn/client/render/RenderCablePart.java +++ b/src/main/java/techreborn/client/render/RenderCablePart.java @@ -1,114 +1,115 @@ package techreborn.client.render; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; -import ic2.api.info.IC2Classic; -import ic2.api.item.IC2Items; -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.util.EnumFacing; -import reborncore.common.misc.Functions; -import reborncore.common.misc.vecmath.Vecs3d; -import reborncore.common.misc.vecmath.Vecs3dCube; -import techreborn.client.IconSupplier; -import techreborn.partSystem.parts.CablePart; +//import net.minecraftforge.fml.relauncher.Side; +//import net.minecraftforge.fml.relauncher.SideOnly; +//import ic2.api.info.IC2Classic; +//import ic2.api.item.IC2Items; +//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.util.EnumFacing; +//import reborncore.common.misc.Functions; +//import reborncore.common.misc.vecmath.Vecs3d; +//import reborncore.common.misc.vecmath.Vecs3dCube; +//import techreborn.client.IconSupplier; +//import techreborn.partSystem.parts.CablePart; public class RenderCablePart { + //TODO 1.8 nope - public static void renderBox(Vecs3dCube cube, Block block, Tessellator tessellator, RenderBlocks renderblocks, IIcon texture, Double xD, Double yD, double zD, float thickness) { - block.setBlockBounds((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ(), (float) cube.getMaxX() + thickness, (float) cube.getMaxY() + thickness, (float) cube.getMaxZ() + thickness); - renderblocks.setRenderBoundsFromBlock(block); - tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F); - renderblocks.renderFaceYNeg(block, xD, yD, zD, texture); - tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); - renderblocks.renderFaceYPos(block, xD, yD, zD, texture); - tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F); - renderblocks.renderFaceZNeg(block, xD, yD, zD, texture); - renderblocks.renderFaceZPos(block, xD, yD, zD, texture); - tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F); - renderblocks.renderFaceXNeg(block, xD, yD, zD, texture); - renderblocks.renderFaceXPos(block, xD, yD, zD, texture); - } - - - @SideOnly(Side.CLIENT) - public static boolean renderStatic(Vecs3d translation, int pass, CablePart part) { - Tessellator tessellator = Tessellator.instance; - IIcon texture = getIconFromType(part.type); - RenderBlocks renderblocks = RenderBlocks.getInstance(); - double xD = part.getPos().getX(); - double yD = part.getPos().getY(); - double zD = part.getPos().getZ(); - Block block = part.getBlockType(); - tessellator.setBrightness(block.getMixedBrightnessForBlock(part.getWorld(), part.getX(), part.getY(), part.getZ())); - renderBox(part.boundingBoxes[6], block, tessellator, renderblocks, texture, xD, yD, zD, 0F); - for (EnumFacing direction : EnumFacing.values()) { - if (part.connectedSides.get(direction) != null) { - renderBox(part.boundingBoxes[Functions.getIntDirFromDirection(direction)], block, tessellator, renderblocks, texture, xD, yD, zD, 0f); - } - } - block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - renderblocks.setRenderBoundsFromBlock(block); - return true; - } - - @SideOnly(Side.CLIENT) - public static IIcon getIconFromType(int cableType) { - if (IC2Classic.getLoadedIC2Type() == IC2Classic.IC2Type.SpeigersClassic) { - return Block.getBlockFromItem(IC2Items.getItem("copperCableBlock").getItem()).getIcon(0, cableType * 16); - } - IIcon p = null; - switch (cableType) { - case 0: - p = IconSupplier.insulatedCopperCable; - break; - case 1: - p = IconSupplier.copperCable; - break; - case 2: - p = IconSupplier.goldCable; - break; - case 3: - p = IconSupplier.insulatedGoldCable; - break; - case 4: - p = IconSupplier.doubleInsulatedGoldCable; - break; - case 5: - p = IconSupplier.ironCable; - break; - case 6: - p = IconSupplier.insulatedIronCable; - break; - case 7: - p = IconSupplier.doubleInsulatedIronCable; - break; - case 8: - p = IconSupplier.trippleInsulatedIronCable; - break; - case 9: - p = IconSupplier.glassFiberCable; - break; - case 10: - p = IconSupplier.tinCable; - break; - case 11: - p = IconSupplier.detectorCableBlock;//Detector - break; - case 12: - p = IconSupplier.splitterCableBlock;// Splitter - break; - case 13: - p = IconSupplier.insulatedtinCableBlock; - break; - case 14: - p = IconSupplier.copperCable; // unused? - } - - return p; - } +// public static void renderBox(Vecs3dCube cube, Block block, Tessellator tessellator, RenderBlocks renderblocks, IIcon texture, Double xD, Double yD, double zD, float thickness) { +// block.setBlockBounds((float) cube.getMinX(), (float) cube.getMinY(), (float) cube.getMinZ(), (float) cube.getMaxX() + thickness, (float) cube.getMaxY() + thickness, (float) cube.getMaxZ() + thickness); +// renderblocks.setRenderBoundsFromBlock(block); +// tessellator.setColorOpaque_F(0.5F, 0.5F, 0.5F); +// renderblocks.renderFaceYNeg(block, xD, yD, zD, texture); +// tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F); +// renderblocks.renderFaceYPos(block, xD, yD, zD, texture); +// tessellator.setColorOpaque_F(0.8F, 0.8F, 0.8F); +// renderblocks.renderFaceZNeg(block, xD, yD, zD, texture); +// renderblocks.renderFaceZPos(block, xD, yD, zD, texture); +// tessellator.setColorOpaque_F(0.6F, 0.6F, 0.6F); +// renderblocks.renderFaceXNeg(block, xD, yD, zD, texture); +// renderblocks.renderFaceXPos(block, xD, yD, zD, texture); +// } +// +// +// @SideOnly(Side.CLIENT) +// public static boolean renderStatic(Vecs3d translation, int pass, CablePart part) { +// Tessellator tessellator = Tessellator.instance; +// IIcon texture = getIconFromType(part.type); +// RenderBlocks renderblocks = RenderBlocks.getInstance(); +// double xD = part.getPos().getX(); +// double yD = part.getPos().getY(); +// double zD = part.getPos().getZ(); +// Block block = part.getBlockType(); +// tessellator.setBrightness(block.getMixedBrightnessForBlock(part.getWorld(), part.getX(), part.getY(), part.getZ())); +// renderBox(part.boundingBoxes[6], block, tessellator, renderblocks, texture, xD, yD, zD, 0F); +// for (EnumFacing direction : EnumFacing.values()) { +// if (part.connectedSides.get(direction) != null) { +// renderBox(part.boundingBoxes[Functions.getIntDirFromDirection(direction)], block, tessellator, renderblocks, texture, xD, yD, zD, 0f); +// } +// } +// block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +// renderblocks.setRenderBoundsFromBlock(block); +// return true; +// } +// +// @SideOnly(Side.CLIENT) +// public static IIcon getIconFromType(int cableType) { +// if (IC2Classic.getLoadedIC2Type() == IC2Classic.IC2Type.SpeigersClassic) { +// return Block.getBlockFromItem(IC2Items.getItem("copperCableBlock").getItem()).getIcon(0, cableType * 16); +// } +// IIcon p = null; +// switch (cableType) { +// case 0: +// p = IconSupplier.insulatedCopperCable; +// break; +// case 1: +// p = IconSupplier.copperCable; +// break; +// case 2: +// p = IconSupplier.goldCable; +// break; +// case 3: +// p = IconSupplier.insulatedGoldCable; +// break; +// case 4: +// p = IconSupplier.doubleInsulatedGoldCable; +// break; +// case 5: +// p = IconSupplier.ironCable; +// break; +// case 6: +// p = IconSupplier.insulatedIronCable; +// break; +// case 7: +// p = IconSupplier.doubleInsulatedIronCable; +// break; +// case 8: +// p = IconSupplier.trippleInsulatedIronCable; +// break; +// case 9: +// p = IconSupplier.glassFiberCable; +// break; +// case 10: +// p = IconSupplier.tinCable; +// break; +// case 11: +// p = IconSupplier.detectorCableBlock;//Detector +// break; +// case 12: +// p = IconSupplier.splitterCableBlock;// Splitter +// break; +// case 13: +// p = IconSupplier.insulatedtinCableBlock; +// break; +// case 14: +// p = IconSupplier.copperCable; // unused? +// } +// +// return p; +// } } diff --git a/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java b/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java index e861701ba..e089049ef 100644 --- a/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java +++ b/src/main/java/techreborn/client/texture/CasingConnectedTextureGenerator.java @@ -3,13 +3,11 @@ package techreborn.client.texture; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.data.AnimationMetadataSection; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import reborncore.client.texture.ConnectedTexture; import techreborn.lib.ModInfo; @@ -18,6 +16,7 @@ import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; +//1.8 Nope public class CasingConnectedTextureGenerator extends TextureAtlasSprite { public BufferedImage output_image = null; @@ -119,23 +118,23 @@ public class CasingConnectedTextureGenerator extends TextureAtlasSprite { } type_image[0] = output_image; - this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); + // this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); return false; } - @SideOnly(Side.CLIENT) - public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta, String[] types) { - if (iconRegister instanceof TextureMap) { - TextureMap map = (TextureMap) iconRegister; - String name = CasingConnectedTextureGenerator.getDerivedName(types[meta] + "." + texNum); - TextureAtlasSprite texture = map.getTextureExtry(name); - if (texture == null) { - texture = new CasingConnectedTextureGenerator(name, types[meta], connectedTexture); - map.setTextureEntry(name, texture); - } - return map.getTextureExtry(name); - } else { - return null; - } - } +// @SideOnly(Side.CLIENT) +// public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta, String[] types) { +// if (iconRegister instanceof TextureMap) { +// TextureMap map = (TextureMap) iconRegister; +// String name = CasingConnectedTextureGenerator.getDerivedName(types[meta] + "." + texNum); +// TextureAtlasSprite texture = map.getTextureExtry(name); +// if (texture == null) { +// texture = new CasingConnectedTextureGenerator(name, types[meta], connectedTexture); +// map.setTextureEntry(name, texture); +// } +// return map.getTextureExtry(name); +// } else { +// return null; +// } +// } } diff --git a/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java b/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java index 4d1f08f19..7ff2fc707 100644 --- a/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java +++ b/src/main/java/techreborn/client/texture/LesuConnectedTextureGenerator.java @@ -1,13 +1,11 @@ package techreborn.client.texture; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.data.AnimationMetadataSection; -import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import reborncore.client.texture.ConnectedTexture; import techreborn.lib.ModInfo; @@ -16,6 +14,8 @@ import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.IOException; + +//TODO 1.8 nope public class LesuConnectedTextureGenerator extends TextureAtlasSprite { public BufferedImage output_image = null; @@ -126,22 +126,22 @@ public class LesuConnectedTextureGenerator extends TextureAtlasSprite { } type_image[0] = output_image; - this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); + // this.loadSprite(type_image, animation, (float) Minecraft.getMinecraft().gameSettings.anisotropicFiltering > 1.0F); return false; } - public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta) { - if (iconRegister instanceof TextureMap) { - TextureMap map = (TextureMap) iconRegister; - String name = LesuConnectedTextureGenerator.getDerivedName("lesu." + texNum); - TextureAtlasSprite texture = map.getTextureExtry(name); - if (texture == null) { - texture = new LesuConnectedTextureGenerator(name, "lesu", connectedTexture); - map.setTextureEntry(name, texture); - } - return map.getTextureExtry(name); - } else { - return null; - } - } +// public static IIcon genIcon(ConnectedTexture connectedTexture, IIconRegister iconRegister, int texNum, int meta) { +// if (iconRegister instanceof TextureMap) { +// TextureMap map = (TextureMap) iconRegister; +// String name = LesuConnectedTextureGenerator.getDerivedName("lesu." + texNum); +// TextureAtlasSprite texture = map.getTextureExtry(name); +// if (texture == null) { +// texture = new LesuConnectedTextureGenerator(name, "lesu", connectedTexture); +// map.setTextureEntry(name, texture); +// } +// return map.getTextureExtry(name); +// } else { +// return null; +// } +// } } diff --git a/src/main/java/techreborn/items/ItemParts.java b/src/main/java/techreborn/items/ItemParts.java index 2d84edce1..b24df6313 100644 --- a/src/main/java/techreborn/items/ItemParts.java +++ b/src/main/java/techreborn/items/ItemParts.java @@ -1,13 +1,9 @@ package techreborn.items; -import ic2.api.reactor.IReactor; -import ic2.api.reactor.IReactorComponent; -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 net.minecraft.world.World; import techreborn.Core; import techreborn.client.GuiHandler; @@ -17,7 +13,7 @@ import techreborn.init.ModItems; import java.security.InvalidParameterException; import java.util.List; -public class ItemParts extends Item implements IReactorComponent { +public class ItemParts extends Item { public static ItemStack getPartByName(String name, int count) { for (int i = 0; i < types.length; i++) { if (types[i].equalsIgnoreCase(name)) { @@ -100,39 +96,4 @@ public class ItemParts extends Item implements IReactorComponent { return itemStack; } - - @Override - public void processChamber(IReactor iReactor, ItemStack itemStack, int i, int i1, boolean b) { - - } - - @Override - public boolean acceptUraniumPulse(IReactor iReactor, ItemStack itemStack, ItemStack itemStack1, int i, int i1, int i2, int i3, boolean b) { - return false; - } - - @Override - public boolean canStoreHeat(IReactor iReactor, ItemStack itemStack, int i, int i1) { - return false; - } - - @Override - public int getMaxHeat(IReactor iReactor, ItemStack itemStack, int i, int i1) { - return 0; - } - - @Override - public int getCurrentHeat(IReactor iReactor, ItemStack itemStack, int i, int i1) { - return 0; - } - - @Override - public int alterHeat(IReactor iReactor, ItemStack itemStack, int i, int i1, int i2) { - return 0; - } - - @Override - public float influenceExplosion(IReactor iReactor, ItemStack itemStack) { - return 0; - } } diff --git a/src/main/java/techreborn/pda/GuiManual.java b/src/main/java/techreborn/pda/GuiManual.java index dbd575b72..24c2e41db 100644 --- a/src/main/java/techreborn/pda/GuiManual.java +++ b/src/main/java/techreborn/pda/GuiManual.java @@ -150,13 +150,9 @@ public class GuiManual extends GuiScreen { root.actionPerformed(button); } - @Override - protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) { - root.mouseMovedOrUp(mouseX, mouseY, clickedMouseButton); - } @Override - public void mouseClicked(int par1, int par2, int par3) { + public void mouseClicked(int par1, int par2, int par3) throws IOException { root.mouseClicked(par1, par2, par3); } diff --git a/src/main/java/techreborn/pda/PageCollection.java b/src/main/java/techreborn/pda/PageCollection.java index 1fca9e80c..a75327db8 100644 --- a/src/main/java/techreborn/pda/PageCollection.java +++ b/src/main/java/techreborn/pda/PageCollection.java @@ -6,6 +6,7 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiButton; import techreborn.pda.pages.BasePage; +import java.io.IOException; import java.util.List; public class PageCollection extends Gui { @@ -71,12 +72,12 @@ public class PageCollection extends Gui { getActivePage().actionPerformed(button); } - protected void mouseMovedOrUp(int par1, int par2, int par3) { - if (getActivePage() == null) return; - getActivePage().mouseMovedOrUp(par1, par2, par3); - } +// protected void mouseMovedOrUp(int par1, int par2, int par3) { +// if (getActivePage() == null) return; +// getActivePage().mo(par1, par2, par3); +// } - protected void mouseClicked(int par1, int par2, int par3) { + protected void mouseClicked(int par1, int par2, int par3) throws IOException { if (getActivePage() == null) return; getActivePage().mouseClicked(par1, par2, par3); } diff --git a/src/main/java/techreborn/tiles/TileMachineBase.java b/src/main/java/techreborn/tiles/TileMachineBase.java index d48ac8ae4..49bf4b095 100644 --- a/src/main/java/techreborn/tiles/TileMachineBase.java +++ b/src/main/java/techreborn/tiles/TileMachineBase.java @@ -68,4 +68,6 @@ public class TileMachineBase extends TileEntity implements ITickable { public void updateEntity() { } + + } diff --git a/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java b/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java index 43c4c058e..fbfdc8680 100644 --- a/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java +++ b/src/main/java/techreborn/tiles/fusionReactor/TileEntityFusionController.java @@ -4,7 +4,9 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; import reborncore.common.util.Inventory; import reborncore.common.util.ItemUtils; import techreborn.api.reactor.FusionReactorRecipe; @@ -15,7 +17,7 @@ import techreborn.powerSystem.TilePowerAcceptor; public class TileEntityFusionController extends TilePowerAcceptor implements IInventory { - public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64); + public Inventory inventory = new Inventory(3, "TileEntityFusionController", 64, this); //0= no coils, 1 = coils public int coilStatus = 0; @@ -127,15 +129,6 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn inventory.setInventorySlotContents(slot, stack); } - @Override - public String getInventoryName() { - return inventory.getInventoryName(); - } - - @Override - public boolean hasCustomInventoryName() { - return inventory.hasCustomInventoryName(); - } @Override public int getInventoryStackLimit() { @@ -148,13 +141,13 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn } @Override - public void openInventory() { - inventory.openInventory(); + public void openInventory(EntityPlayer player) { + inventory.openInventory(player); } @Override - public void closeInventory() { - inventory.closeInventory(); + public void closeInventory(EntityPlayer player) { + inventory.closeInventory(player); } @Override @@ -162,6 +155,26 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn return inventory.isItemValidForSlot(slot, stack); } + @Override + public int getField(int id) { + return inventory.getField(id); + } + + @Override + public void setField(int id, int value) { + inventory.setField(id, value); + } + + @Override + public int getFieldCount() { + return inventory.getFieldCount(); + } + + @Override + public void clear() { + inventory.clear(); + } + public boolean checkCoils() { if ((isCoil(this.getPos().getX() + 3, this.getPos().getY(), this.getPos().getZ() + 1)) && @@ -196,7 +209,7 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn } private boolean isCoil(int x, int y, int z) { - return worldObj.getBlock(x, y, z) == ModBlocks.FusionCoil; + return worldObj.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FusionCoil; } @Override @@ -324,8 +337,17 @@ public class TileEntityFusionController extends TilePowerAcceptor implements IIn } @Override - public void onLoaded() { - super.onLoaded(); - checkCoils(); + public String getCommandSenderName() { + return null; + } + + @Override + public boolean hasCustomName() { + return false; + } + + @Override + public IChatComponent getDisplayName() { + return null; } } diff --git a/src/main/java/techreborn/tiles/idsu/TileIDSU.java b/src/main/java/techreborn/tiles/idsu/TileIDSU.java index c61926e7c..79b6caaf8 100644 --- a/src/main/java/techreborn/tiles/idsu/TileIDSU.java +++ b/src/main/java/techreborn/tiles/idsu/TileIDSU.java @@ -141,7 +141,7 @@ public class TileIDSU extends TilePowerAcceptor { ItemStack dropStack = new ItemStack(ModBlocks.Idsu, 1); writeToNBT(tileEntity); dropStack.setTagCompound(new NBTTagCompound()); - dropStack.stackTagCompound.setTag("tileEntity", tileEntity); + dropStack.getTagCompound().setTag("tileEntity", tileEntity); return dropStack; } diff --git a/src/main/java/techreborn/tiles/lesu/TileLesu.java b/src/main/java/techreborn/tiles/lesu/TileLesu.java index daaca5d82..fbdc97d48 100644 --- a/src/main/java/techreborn/tiles/lesu/TileLesu.java +++ b/src/main/java/techreborn/tiles/lesu/TileLesu.java @@ -1,6 +1,7 @@ package techreborn.tiles.lesu; +import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import reborncore.common.misc.Functions; import reborncore.common.util.Inventory; @@ -20,7 +21,7 @@ public class TileLesu extends TilePowerAcceptor {//TODO wrench private int output; private int maxStorage; - public Inventory inventory = new Inventory(2, "TileAesu", 64); + public Inventory inventory = new Inventory(2, "TileAesu", 64, this); public TileLesu() { super(5); @@ -34,10 +35,10 @@ public class TileLesu extends TilePowerAcceptor {//TODO wrench } countedNetworks.clear(); connectedBlocks = 0; - for (EnumFacing dir : EnumFacing.VALID_DIRECTIONS) { - if (worldObj.getTileEntity(getPos().getX() + dir.offsetX, getPos().getY() + dir.offsetY, getPos().getZ() + dir.offsetZ) instanceof TileLesuStorage) { - if (((TileLesuStorage) worldObj.getTileEntity(getPos().getX() + dir.offsetX, getPos().getY() + dir.offsetY, getPos().getZ() + dir.offsetZ)).network != null) { - LesuNetwork network = ((TileLesuStorage) worldObj.getTileEntity(getPos().getX() + dir.offsetX, getPos().getY() + dir.offsetY, getPos().getZ() + dir.offsetZ)).network; + for (EnumFacing dir : EnumFacing.values()) { + if (worldObj.getTileEntity(new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), getPos().getZ() + dir.getFrontOffsetZ())) instanceof TileLesuStorage) { + if (((TileLesuStorage) worldObj.getTileEntity(new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), getPos().getZ() + dir.getFrontOffsetZ()))).network != null) { + LesuNetwork network = ((TileLesuStorage) worldObj.getTileEntity(new BlockPos(getPos().getX() + dir.getFrontOffsetX(), getPos().getY() + dir.getFrontOffsetY(), getPos().getZ() + dir.getFrontOffsetZ()))).network; if (!countedNetworks.contains(network)) { if (network.master == null || network.master == this) { connectedBlocks += network.storages.size(); diff --git a/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java b/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java index aa4d232fa..de7f9bb5c 100644 --- a/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java +++ b/src/main/java/techreborn/tiles/lesu/TileLesuStorage.java @@ -1,5 +1,6 @@ package techreborn.tiles.lesu; +import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.util.EnumFacing; import techreborn.tiles.TileMachineBase; @@ -14,7 +15,7 @@ public class TileLesuStorage extends TileMachineBase { if (network == null) { findAndJoinNetwork(worldObj, getPos().getX(), getPos().getY(), getPos().getZ()); } else { - if (network.master != null && network.master.getWorld().getTileEntity(network.master.getPos().getX(), network.master.getPos().getY(), network.master.getPos().getZ()) != network.master) { + if (network.master != null && network.master.getWorld().getTileEntity(new BlockPos(network.master.getPos().getX(), network.master.getPos().getY(), network.master.getPos().getZ())) != network.master) { network.master = null; } } @@ -23,9 +24,9 @@ public class TileLesuStorage extends TileMachineBase { public final void findAndJoinNetwork(World world, int x, int y, int z) { network = new LesuNetwork(); network.addElement(this); - for (EnumFacing direction : EnumFacing.VALID_DIRECTIONS) { - if (world.getTileEntity(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ) instanceof TileLesuStorage) { - TileLesuStorage lesu = (TileLesuStorage) world.getTileEntity(x + direction.offsetX, y + direction.offsetY, z + direction.offsetZ); + for (EnumFacing direction : EnumFacing.values()) { + if (world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(), z + direction.getFrontOffsetZ())) instanceof TileLesuStorage) { + TileLesuStorage lesu = (TileLesuStorage) world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(), z + direction.getFrontOffsetZ())); if (lesu.network != null) { lesu.network.merge(network); } diff --git a/src/main/java/techreborn/world/TROreGen.java b/src/main/java/techreborn/world/TROreGen.java index eb74d7ea0..a9eb22da6 100644 --- a/src/main/java/techreborn/world/TROreGen.java +++ b/src/main/java/techreborn/world/TROreGen.java @@ -33,27 +33,28 @@ public class TROreGen implements IWorldGenerator { WorldGenMinable oreSilver; public TROreGen() { - // World - oreGalena = new WorldGenMinable(ModBlocks.ore, 0, ConfigTechReborn.GalenaOreRare, Blocks.stone); - oreIridium = new WorldGenMinable(ModBlocks.ore, 1, ConfigTechReborn.IridiumOreRare, Blocks.stone); - oreRuby = new WorldGenMinable(ModBlocks.ore, 2, ConfigTechReborn.RubyOreRare, Blocks.stone); - oreSapphire = new WorldGenMinable(ModBlocks.ore, 3, ConfigTechReborn.SapphireOreRare, Blocks.stone); - oreBauxite = new WorldGenMinable(ModBlocks.ore, 4, ConfigTechReborn.BauxiteOreRare, Blocks.stone); - oreTetrahedrite = new WorldGenMinable(ModBlocks.ore, 12, ConfigTechReborn.TetrahedriteOreRare, Blocks.stone); - oreCassiterite = new WorldGenMinable(ModBlocks.ore, 13, ConfigTechReborn.CassiteriteOreRare, Blocks.stone); - oreLead = new WorldGenMinable(ModBlocks.ore, 14, ConfigTechReborn.LeadOreRare, Blocks.stone); - oreSilver = new WorldGenMinable(ModBlocks.ore, 15, ConfigTechReborn.SilverOreRare, Blocks.stone); - - // Nether - orePyrite = new WorldGenMinable(ModBlocks.ore, 5, ConfigTechReborn.PyriteOreRare, Blocks.netherrack); - oreCinnabar = new WorldGenMinable(ModBlocks.ore, 6, ConfigTechReborn.CinnabarOreRare, Blocks.netherrack); - oreSphalerite = new WorldGenMinable(ModBlocks.ore, 7, ConfigTechReborn.SphaleriteOreRare, Blocks.netherrack); - - // End - oreTungston = new WorldGenMinable(ModBlocks.ore, 8, ConfigTechReborn.TungstenOreRare, Blocks.end_stone); - oreSheldonite = new WorldGenMinable(ModBlocks.ore, 9, ConfigTechReborn.SheldoniteOreRare, Blocks.end_stone); - orePeridot = new WorldGenMinable(ModBlocks.ore, 10, ConfigTechReborn.PeridotOreRare, Blocks.end_stone); - oreSodalite = new WorldGenMinable(ModBlocks.ore, 11, ConfigTechReborn.SodaliteOreRare, Blocks.end_stone); + //TODO meta fix +// // World +// oreGalena = new WorldGenMinable(ModBlocks.ore, 0, ConfigTechReborn.GalenaOreRare, Blocks.stone); +// oreIridium = new WorldGenMinable(ModBlocks.ore, 1, ConfigTechReborn.IridiumOreRare, Blocks.stone); +// oreRuby = new WorldGenMinable(ModBlocks.ore, 2, ConfigTechReborn.RubyOreRare, Blocks.stone); +// oreSapphire = new WorldGenMinable(ModBlocks.ore, 3, ConfigTechReborn.SapphireOreRare, Blocks.stone); +// oreBauxite = new WorldGenMinable(ModBlocks.ore, 4, ConfigTechReborn.BauxiteOreRare, Blocks.stone); +// oreTetrahedrite = new WorldGenMinable(ModBlocks.ore, 12, ConfigTechReborn.TetrahedriteOreRare, Blocks.stone); +// oreCassiterite = new WorldGenMinable(ModBlocks.ore, 13, ConfigTechReborn.CassiteriteOreRare, Blocks.stone); +// oreLead = new WorldGenMinable(ModBlocks.ore, 14, ConfigTechReborn.LeadOreRare, Blocks.stone); +// oreSilver = new WorldGenMinable(ModBlocks.ore, 15, ConfigTechReborn.SilverOreRare, Blocks.stone); +// +// // Nether +// orePyrite = new WorldGenMinable(ModBlocks.ore, 5, ConfigTechReborn.PyriteOreRare, Blocks.netherrack); +// oreCinnabar = new WorldGenMinable(ModBlocks.ore, 6, ConfigTechReborn.CinnabarOreRare, Blocks.netherrack); +// oreSphalerite = new WorldGenMinable(ModBlocks.ore, 7, ConfigTechReborn.SphaleriteOreRare, Blocks.netherrack); +// +// // End +// oreTungston = new WorldGenMinable(ModBlocks.ore, 8, ConfigTechReborn.TungstenOreRare, Blocks.end_stone); +// oreSheldonite = new WorldGenMinable(ModBlocks.ore, 9, ConfigTechReborn.SheldoniteOreRare, Blocks.end_stone); +// orePeridot = new WorldGenMinable(ModBlocks.ore, 10, ConfigTechReborn.PeridotOreRare, Blocks.end_stone); +// oreSodalite = new WorldGenMinable(ModBlocks.ore, 11, ConfigTechReborn.SodaliteOreRare, Blocks.end_stone); Core.logHelper.info("WorldGen Loaded"); }