diff options
Diffstat (limited to 'src/main/java/common')
33 files changed, 1 insertions, 2169 deletions
diff --git a/src/main/java/common/Blocks.java b/src/main/java/common/Blocks.java index f43482b909..4003e8e9e4 100644 --- a/src/main/java/common/Blocks.java +++ b/src/main/java/common/Blocks.java @@ -17,15 +17,9 @@ public class Blocks { public static Block yszUnit; public static Block gdcUnit; public static Block tfftStorageField; - public static Block reactorChamberOFF; - public static Block reactorChamberON; - public static Block reactorControlRod; public static Block jarThaumiumReinforced; public static Block jarIchor; public static Block lscLapotronicEnergyUnit; - public static Block spaceElevatorStructure; - public static Block spaceElevatorCapacitor; - public static Block spaceElevatorTether; public static Block largeHexPlate; diff --git a/src/main/java/common/CommonProxy.java b/src/main/java/common/CommonProxy.java index 3af1fd1671..540e6ced89 100644 --- a/src/main/java/common/CommonProxy.java +++ b/src/main/java/common/CommonProxy.java @@ -2,24 +2,18 @@ package common; import common.items.ErrorItem; import common.items.MetaItem_CraftingComponent; -import common.items.MetaItem_ReactorComponent; import common.tileentities.GTMTE_TFFTHatch; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import gregtech.api.GregTech_API; -import kekztech.GuiHandler; import kekztech.Items; -import kekztech.KekzCore; public class CommonProxy { public void preInit(final FMLPreInitializationEvent e) { // Items ErrorItem.getInstance().registerItem(); - MetaItem_ReactorComponent.getInstance().registerItem(); MetaItem_CraftingComponent.getInstance().registerItem(); Items.registerOreDictNames(); // Blocks @@ -28,8 +22,6 @@ public class CommonProxy { TileEntities.preInit(); // TC Research Researches.preInit(); - // GUI Handler - NetworkRegistry.INSTANCE.registerGuiHandler(KekzCore.instance, new GuiHandler()); } public void init(final FMLInitializationEvent e) { @@ -43,6 +35,6 @@ public class CommonProxy { // Research Researches.postInit(); - if (GregTech_API.mAE2) GTMTE_TFFTHatch.registerAEIntegration(); + GTMTE_TFFTHatch.registerAEIntegration(); } } diff --git a/src/main/java/common/TileEntities.java b/src/main/java/common/TileEntities.java index 9ad4fdb99f..31246ac5d8 100644 --- a/src/main/java/common/TileEntities.java +++ b/src/main/java/common/TileEntities.java @@ -3,7 +3,6 @@ package common; import common.tileentities.GTMTE_LapotronicSuperCapacitor; import common.tileentities.GTMTE_SOFuelCellMK1; import common.tileentities.GTMTE_SOFuelCellMK2; -import common.tileentities.GTMTE_SpaceElevator; import common.tileentities.GTMTE_TFFT; import common.tileentities.GTMTE_TFFTHatch; import common.tileentities.TE_IchorJar; @@ -18,10 +17,8 @@ public class TileEntities { // Multiblock controllers public static GTMTE_SOFuelCellMK1 sofc1; public static GTMTE_SOFuelCellMK2 sofc2; - // public static GTMTE_ModularNuclearReactor mdr; public static GTMTE_TFFT tfft; public static GTMTE_LapotronicSuperCapacitor lsc; - public static GTMTE_SpaceElevator se; // Singleblocks public static GTMTE_TFFTHatch tfftHatch; diff --git a/src/main/java/common/blocks/Block_BeamTransmitter.java b/src/main/java/common/blocks/Block_BeamTransmitter.java deleted file mode 100644 index 48bedd3b7f..0000000000 --- a/src/main/java/common/blocks/Block_BeamTransmitter.java +++ /dev/null @@ -1,53 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.tileentities.TE_BeamTransmitter; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.KekzCore; - -public class Block_BeamTransmitter extends Block { - - private static final Block_BeamTransmitter INSTANCE = new Block_BeamTransmitter(); - - private Block_BeamTransmitter() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_beamtransmitter_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(5.0f); - INSTANCE.setResistance(5.0f); - INSTANCE.setBlockTextureName(KekzCore.MODID + ":" + "Tether_top"); - GameRegistry.registerBlock(INSTANCE, blockName); - - return INSTANCE; - } - - @Override - public TileEntity createTileEntity(World world, int meta) { - return new TE_BeamTransmitter(); - } - - @Override - public boolean hasTileEntity(int meta) { - return true; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } -} diff --git a/src/main/java/common/blocks/Block_ControlRod.java b/src/main/java/common/blocks/Block_ControlRod.java deleted file mode 100644 index 7c86c9910f..0000000000 --- a/src/main/java/common/blocks/Block_ControlRod.java +++ /dev/null @@ -1,29 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.KekzCore; - -public class Block_ControlRod extends BaseGTUpdateableBlock { - - private static final Block_ControlRod instance = new Block_ControlRod(); - - private Block_ControlRod() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_controlrod_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ControlRod"); - instance.setHardness(5.0f); - instance.setResistance(6.0f); - GameRegistry.registerBlock(instance, blockName); - - return instance; - } -} diff --git a/src/main/java/common/blocks/Block_ItemProxyCable.java b/src/main/java/common/blocks/Block_ItemProxyCable.java deleted file mode 100644 index cf9307dde0..0000000000 --- a/src/main/java/common/blocks/Block_ItemProxyCable.java +++ /dev/null @@ -1,68 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.itemBlocks.IB_ItemProxyCable; -import common.tileentities.TE_ItemProxyCable; - -import client.renderer.ConduitRenderer; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import kekztech.KekzCore; - -public class Block_ItemProxyCable extends Block { - - private static final Block_ItemProxyCable instance = new Block_ItemProxyCable(); - - private Block_ItemProxyCable() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_itemproxycable_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "TFFTCasing"); - instance.setHardness(3.0f); - instance.setResistance(2.0f); - GameRegistry.registerBlock(instance, IB_ItemProxyCable.class, blockName); - - return instance; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_ItemProxyCable(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 1; - } - - @Override - public int getRenderType() { - return ConduitRenderer.RID; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } -} diff --git a/src/main/java/common/blocks/Block_ItemProxyEndpoint.java b/src/main/java/common/blocks/Block_ItemProxyEndpoint.java deleted file mode 100644 index 5f60eba040..0000000000 --- a/src/main/java/common/blocks/Block_ItemProxyEndpoint.java +++ /dev/null @@ -1,63 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.itemBlocks.IB_ItemProxyEndpoint; -import common.tileentities.TE_ItemProxyEndpoint; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.GuiHandler; -import kekztech.KekzCore; - -public class Block_ItemProxyEndpoint extends Block { - - private static final Block_ItemProxyEndpoint instance = new Block_ItemProxyEndpoint(); - - private Block_ItemProxyEndpoint() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_itemproxyendpoint_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ItemProxyEndpoint"); - instance.setHardness(3.0f); - instance.setResistance(2.0f); - instance.setHarvestLevel("wrench", 2); - GameRegistry.registerBlock(instance, IB_ItemProxyEndpoint.class, blockName); - - return instance; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, - float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if (te instanceof TE_ItemProxyEndpoint) { - player.openGui(KekzCore.instance, GuiHandler.ITEM_PROXY_ENDPOINT, world, x, y, z); - return true; - } else { - return false; - } - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_ItemProxyEndpoint(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } -} diff --git a/src/main/java/common/blocks/Block_ItemProxySource.java b/src/main/java/common/blocks/Block_ItemProxySource.java deleted file mode 100644 index 7ab34ade52..0000000000 --- a/src/main/java/common/blocks/Block_ItemProxySource.java +++ /dev/null @@ -1,63 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import common.itemBlocks.IB_ItemProxySource; -import common.tileentities.TE_ItemProxySource; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.GuiHandler; -import kekztech.KekzCore; - -public class Block_ItemProxySource extends Block { - - private static final Block_ItemProxySource instance = new Block_ItemProxySource(); - - private Block_ItemProxySource() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_itemproxysource_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ItemProxySource"); - instance.setHardness(3.0f); - instance.setResistance(2.0f); - instance.setHarvestLevel("wrench", 2); - GameRegistry.registerBlock(instance, IB_ItemProxySource.class, blockName); - - return instance; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float lx, float ly, - float lz) { - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if (te instanceof TE_ItemProxySource) { - player.openGui(KekzCore.instance, GuiHandler.ITEM_PROXY_SOURCE, world, x, y, z); - return true; - } else { - return false; - } - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_ItemProxySource(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } -} diff --git a/src/main/java/common/blocks/Block_ReactorChamber_OFF.java b/src/main/java/common/blocks/Block_ReactorChamber_OFF.java deleted file mode 100644 index 3c8b29c3cc..0000000000 --- a/src/main/java/common/blocks/Block_ReactorChamber_OFF.java +++ /dev/null @@ -1,29 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.KekzCore; - -public class Block_ReactorChamber_OFF extends BaseGTUpdateableBlock { - - private static final Block_ReactorChamber_OFF instance = new Block_ReactorChamber_OFF(); - - private Block_ReactorChamber_OFF() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_reactorchamberoff_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ReactorChamber_OFF"); - instance.setHardness(10.0f); - instance.setResistance(16.0f); - GameRegistry.registerBlock(instance, blockName); - - return instance; - } -} diff --git a/src/main/java/common/blocks/Block_ReactorChamber_ON.java b/src/main/java/common/blocks/Block_ReactorChamber_ON.java deleted file mode 100644 index 7a894561ae..0000000000 --- a/src/main/java/common/blocks/Block_ReactorChamber_ON.java +++ /dev/null @@ -1,34 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.creativetab.CreativeTabs; - -import cpw.mods.fml.common.registry.GameRegistry; -import kekztech.KekzCore; - -public class Block_ReactorChamber_ON extends BaseGTUpdateableBlock { - - private static final Block_ReactorChamber_ON instance = new Block_ReactorChamber_ON(); - - private Block_ReactorChamber_ON() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_reactorchamberon_block"; - instance.setBlockName(blockName); - instance.setCreativeTab(CreativeTabs.tabMisc); - instance.setBlockTextureName(KekzCore.MODID + ":" + "ReactorChamber_ON"); - instance.setHardness(-1.0f); - instance.setResistance(16.0f); - GameRegistry.registerBlock(instance, blockName); - - return instance; - } - - @Override - public int getLightValue() { - return 15; - } -} diff --git a/src/main/java/common/blocks/Block_SpaceElevator.java b/src/main/java/common/blocks/Block_SpaceElevator.java deleted file mode 100644 index 2f491db0a4..0000000000 --- a/src/main/java/common/blocks/Block_SpaceElevator.java +++ /dev/null @@ -1,62 +0,0 @@ -package common.blocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import common.itemBlocks.IB_SpaceElevator; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class Block_SpaceElevator extends BaseGTUpdateableBlock { - - private static final Block_SpaceElevator INSTANCE = new Block_SpaceElevator(); - - private IIcon baseTop; - private IIcon baseSide; - private IIcon coilHolder; - - private Block_SpaceElevator() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_spaceelevator_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(7.0f); - INSTANCE.setResistance(10.0f); - GameRegistry.registerBlock(INSTANCE, IB_SpaceElevator.class, blockName); - - return INSTANCE; - } - - @Override - public void registerBlockIcons(IIconRegister ir) { - baseTop = ir.registerIcon("kekztech:SpaceElevatorBase_top"); - baseSide = ir.registerIcon("kekztech:SpaceElevatorBase_side"); - coilHolder = ir.registerIcon("kekztech:CoilHolder"); - } - - @Override - @SuppressWarnings({ "unchecked" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - par3List.add(new ItemStack(par1, 1, 1)); - } - - @Override - public IIcon getIcon(int side, int meta) { - if (meta == 0) { - return (side < 2) ? baseTop : baseSide; - } else { - return coilHolder; - } - } -} diff --git a/src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java b/src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java deleted file mode 100644 index b6816ba7e8..0000000000 --- a/src/main/java/common/blocks/Block_SpaceElevatorCapacitor.java +++ /dev/null @@ -1,82 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import common.itemBlocks.IB_SpaceElevatorCapacitor; -import common.tileentities.TE_SpaceElevatorCapacitor; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class Block_SpaceElevatorCapacitor extends BaseGTUpdateableBlock { - - private static final Block_SpaceElevatorCapacitor INSTANCE = new Block_SpaceElevatorCapacitor(); - - private IIcon top; - private IIcon side; - - private Block_SpaceElevatorCapacitor() { - super(Material.iron); - } - - public static Block registerBlock() { - final String blockName = "kekztech_spaceelevatorcapacitor_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(5.0f); - INSTANCE.setResistance(3.0f); - GameRegistry.registerBlock(INSTANCE, IB_SpaceElevatorCapacitor.class, blockName); - - return INSTANCE; - } - - @Override - public void registerBlockIcons(IIconRegister ir) { - top = ir.registerIcon("kekztech:SpaceElevatorCapacitor_top_fullbase"); - side = ir.registerIcon("kekztech:SpaceElevatorCapacitor_side_fullbase"); - } - - @Override - public IIcon getIcon(int side, int meta) { - return (side < 2) ? this.top : this.side; - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_SpaceElevatorCapacitor(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) { - return false; - } - - @Override - public int getLightValue() { - return 2; - } -} diff --git a/src/main/java/common/blocks/Block_SpaceElevatorTether.java b/src/main/java/common/blocks/Block_SpaceElevatorTether.java deleted file mode 100644 index c6ed0f54b0..0000000000 --- a/src/main/java/common/blocks/Block_SpaceElevatorTether.java +++ /dev/null @@ -1,67 +0,0 @@ -package common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import common.tileentities.TE_SpaceElevatorTether; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class Block_SpaceElevatorTether extends BaseGTUpdateableBlock { - - private static final Block_SpaceElevatorTether INSTANCE = new Block_SpaceElevatorTether(); - - private IIcon top; - private IIcon side; - - private Block_SpaceElevatorTether() { - super(Material.glass); - } - - public static Block registerBlock() { - final String blockName = "kekztech_spaceelevatortether_block"; - INSTANCE.setBlockName(blockName); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setHardness(15.0f); - INSTANCE.setResistance(15.0f); - GameRegistry.registerBlock(INSTANCE, blockName); - - return INSTANCE; - } - - @Override - public void registerBlockIcons(IIconRegister ir) { - top = ir.registerIcon("kekztech:Tether_top"); - side = ir.registerIcon("kekztech:Tether_side"); - } - - @Override - public IIcon getIcon(int side, int meta) { - return (side < 2) ? this.top : this.side; - } - - @Override - public TileEntity createTileEntity(World world, int p_149915_2_) { - return new TE_SpaceElevatorTether(); - } - - @Override - public boolean hasTileEntity(int metadata) { - return true; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } -} diff --git a/src/main/java/common/container/Container_ItemProxyEndpoint.java b/src/main/java/common/container/Container_ItemProxyEndpoint.java deleted file mode 100644 index 8f509e789c..0000000000 --- a/src/main/java/common/container/Container_ItemProxyEndpoint.java +++ /dev/null @@ -1,66 +0,0 @@ -package common.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class Container_ItemProxyEndpoint extends Container { - - private final IInventory teInventory; - - private int slotID = 0; - - public Container_ItemProxyEndpoint(TileEntity te, EntityPlayer player) { - this.teInventory = (IInventory) te; - - // Source Slot - addSlotToContainer(new Slot(teInventory, slotID++, 80, 35)); - // Config slot - addSlotToContainer(new Slot(teInventory, slotID++, 100, 35)); - - // Inventory - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - // Hotbar - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) { - ItemStack stack = null; - final Slot slot = (Slot) inventorySlots.get(slotRaw); - - if (slot != null && slot.getHasStack()) { - final ItemStack stackInSlot = slot.getStack(); - stack = stackInSlot.copy(); - - if (slotRaw < 3 * 9) { - if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) { - return null; - } - } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - } - return stack; - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return teInventory.isUseableByPlayer(player); - } -} diff --git a/src/main/java/common/container/Container_ItemProxySource.java b/src/main/java/common/container/Container_ItemProxySource.java deleted file mode 100644 index 23af97e5bb..0000000000 --- a/src/main/java/common/container/Container_ItemProxySource.java +++ /dev/null @@ -1,79 +0,0 @@ -package common.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class Container_ItemProxySource extends Container { - - private final IInventory teInventory; - - private int slotID = 0; - - public Container_ItemProxySource(TileEntity te, EntityPlayer player) { - this.teInventory = (IInventory) te; - - // Source Slots - addSlotToContainer(new Slot(teInventory, slotID++, 53, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 8)); - addSlotToContainer(new Slot(teInventory, slotID++, 53, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 26)); - addSlotToContainer(new Slot(teInventory, slotID++, 53, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 44)); - addSlotToContainer(new Slot(teInventory, slotID++, 53, 62)); - addSlotToContainer(new Slot(teInventory, slotID++, 71, 62)); - addSlotToContainer(new Slot(teInventory, slotID++, 89, 62)); - addSlotToContainer(new Slot(teInventory, slotID++, 107, 62)); - - // Inventory - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - // Hotbar - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142)); - } - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) { - ItemStack stack = null; - final Slot slot = (Slot) inventorySlots.get(slotRaw); - - if (slot != null && slot.getHasStack()) { - final ItemStack stackInSlot = slot.getStack(); - stack = stackInSlot.copy(); - - if (slotRaw < 3 * 9) { - if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) { - return null; - } - } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - } - return stack; - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return teInventory.isUseableByPlayer(player); - } -} diff --git a/src/main/java/common/container/Container_ModularNuclearReactor.java b/src/main/java/common/container/Container_ModularNuclearReactor.java deleted file mode 100644 index d3a06a2f61..0000000000 --- a/src/main/java/common/container/Container_ModularNuclearReactor.java +++ /dev/null @@ -1,77 +0,0 @@ -package common.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import reactor.ButtonSlot; - -public class Container_ModularNuclearReactor extends Container { - - private int nextSlotID = 0; - private final Slot[] REACTOR_SLOTS = new Slot[54]; - private final Slot SLOT_CONFIGURATION; - private final Slot BUTTON_EU_MODE; - private final Slot BUTTON_FLUID_MODE; - private final Slot BUTTON_CONDITION; - private final Slot BUTTON_CONFIGURE; - private final Slot BUTTON_RESET; - - public Container_ModularNuclearReactor(IGregTechTileEntity te, EntityPlayer player) { - - // Add the reactor chamber - for (int x = 0; x < 9; x++) { - for (int y = 0; y < 6; y++) { - REACTOR_SLOTS[nextSlotID] = super.addSlotToContainer( - new Slot(te, getNextSlotID(), (16 + 67 * x), (16 + 67 * y))); - } - } - // Add the configuration slot - SLOT_CONFIGURATION = super.addSlotToContainer(new Slot(te, getNextSlotID(), 0, 0)); - - // Add buttons (they're also slots) - BUTTON_EU_MODE = super.addSlotToContainer(new ButtonSlot(te, getNextSlotID(), 0, 0)); - BUTTON_FLUID_MODE = super.addSlotToContainer(new ButtonSlot(te, getNextSlotID(), 0, 0)); - BUTTON_CONDITION = super.addSlotToContainer(new ButtonSlot(te, getNextSlotID(), 0, 0)); - BUTTON_CONFIGURE = super.addSlotToContainer(new ButtonSlot(te, getNextSlotID(), 0, 0)); - BUTTON_RESET = super.addSlotToContainer(new ButtonSlot(te, getNextSlotID(), 0, 0)); - } - - private int getNextSlotID() { - nextSlotID++; - return nextSlotID - 1; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) { - ItemStack stack = null; - final Slot slot = (Slot) inventorySlots.get(slotRaw); - - if (slot != null && slot.getHasStack()) { - final ItemStack stackInSlot = slot.getStack(); - stack = stackInSlot.copy(); - - if (slotRaw < 3 * 9) { - if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) { - return null; - } - } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slot.putStack(null); - } else { - slot.onSlotChanged(); - } - } - return stack; - } - - @Override - public boolean canInteractWith(EntityPlayer p_75145_1_) { - return true; - } -} diff --git a/src/main/java/common/itemBlocks/IB_ItemProxyCable.java b/src/main/java/common/itemBlocks/IB_ItemProxyCable.java deleted file mode 100644 index 6022194225..0000000000 --- a/src/main/java/common/itemBlocks/IB_ItemProxyCable.java +++ /dev/null @@ -1,22 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_ItemProxyCable extends ItemBlock { - - public IB_ItemProxyCable(Block block) { - super(block); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_itemproxycable_block.0.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java b/src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java deleted file mode 100644 index 2cde2c14d3..0000000000 --- a/src/main/java/common/itemBlocks/IB_ItemProxyEndpoint.java +++ /dev/null @@ -1,23 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_ItemProxyEndpoint extends ItemBlock { - - public IB_ItemProxyEndpoint(Block block) { - super(block); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_itemproxyendpoint_block.0.desc")); - lines.add(StatCollector.translateToLocal("tile.kekztech_itemproxyendpoint_block.1.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_ItemProxySource.java b/src/main/java/common/itemBlocks/IB_ItemProxySource.java deleted file mode 100644 index 42371ab6e6..0000000000 --- a/src/main/java/common/itemBlocks/IB_ItemProxySource.java +++ /dev/null @@ -1,24 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_ItemProxySource extends ItemBlock { - - public IB_ItemProxySource(Block block) { - super(block); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile:kekztech_itemproxysource_block.0.desc")); - lines.add(StatCollector.translateToLocal("tile:kekztech_itemproxysource_block.1.desc")); - lines.add(StatCollector.translateToLocal("tile:kekztech_itemproxysource_block.2.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_SpaceElevator.java b/src/main/java/common/itemBlocks/IB_SpaceElevator.java deleted file mode 100644 index 8b7668207b..0000000000 --- a/src/main/java/common/itemBlocks/IB_SpaceElevator.java +++ /dev/null @@ -1,37 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_SpaceElevator extends ItemBlock { - - public IB_SpaceElevator(Block block) { - super(block); - } - - @Override - public int getMetadata(int meta) { - return meta; - } - - @Override - public boolean getHasSubtypes() { - return true; - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return super.getUnlocalizedName() + "." + stack.getItemDamage(); - } - - @SuppressWarnings("unchecked") - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_spaceelevator_block.desc")); - } -} diff --git a/src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java b/src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java deleted file mode 100644 index fc367ae6a5..0000000000 --- a/src/main/java/common/itemBlocks/IB_SpaceElevatorCapacitor.java +++ /dev/null @@ -1,22 +0,0 @@ -package common.itemBlocks; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; - -public class IB_SpaceElevatorCapacitor extends ItemBlock { - - public IB_SpaceElevatorCapacitor(Block block) { - super(block); - } - - @SuppressWarnings("unchecked") - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List lines, boolean advancedTooltips) { - lines.add(StatCollector.translateToLocal("tile.kekztech_spaceelevatorcapacitor_block.desc")); - } -} diff --git a/src/main/java/common/items/MetaItem_CraftingComponent.java b/src/main/java/common/items/MetaItem_CraftingComponent.java index 3b5d9238b1..205e7392c5 100644 --- a/src/main/java/common/items/MetaItem_CraftingComponent.java +++ b/src/main/java/common/items/MetaItem_CraftingComponent.java @@ -35,17 +35,6 @@ public class MetaItem_CraftingComponent extends Item { @Override public void registerIcons(IIconRegister reg) { int counter = 9; - // Raw heat pipes - /* - * icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "CopperHeatPipe"); icons[counter++] = - * reg.registerIcon(KekzCore.MODID + ":" + "SilverHeatPipe"); icons[counter++] = reg.registerIcon(KekzCore.MODID - * + ":" + "BoronArsenideHeatPipe"); icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + - * "DiamondHeatPipe"); // Dust icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "BoronArsenideDust"); - * icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "IsotopicallyPureDiamondDust"); icons[counter++] = - * reg.registerIcon(KekzCore.MODID + ":" + "AmineCarbamateDust"); // Crystal icons[counter++] = - * reg.registerIcon(KekzCore.MODID + ":" + "BoronArsenideCrystal"); icons[counter++] = - * reg.registerIcon(KekzCore.MODID + ":" + "IsotopicallyPureDiamondCrystal"); - */ // Ceramics icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "YSZCeramicDust"); icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + "GDCCeramicDust"); diff --git a/src/main/java/common/items/MetaItem_ReactorComponent.java b/src/main/java/common/items/MetaItem_ReactorComponent.java deleted file mode 100644 index 45e3a17798..0000000000 --- a/src/main/java/common/items/MetaItem_ReactorComponent.java +++ /dev/null @@ -1,119 +0,0 @@ -package common.items; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; - -import org.lwjgl.input.Keyboard; - -import kekztech.KekzCore; -import reactor.items.CoolantCell; -import reactor.items.FuelRod; -import reactor.items.HeatExchanger; -import reactor.items.HeatVent; -import reactor.items.NeutronReflector; - -public class MetaItem_ReactorComponent extends Item { - - private static final MetaItem_ReactorComponent INSTANCE = new MetaItem_ReactorComponent(); - private final IIcon[] icons = new IIcon[50]; - - private MetaItem_ReactorComponent() {} - - public static MetaItem_ReactorComponent getInstance() { - return INSTANCE; - } - - public void registerItem() { - super.setHasSubtypes(true); - final String unlocalizedName = "kekztech_reactor_item"; - super.setUnlocalizedName(unlocalizedName); - super.setCreativeTab(CreativeTabs.tabMisc); - super.setMaxStackSize(1); - // GameRegistry.registerItem(getInstance(), unlocalizedName); - } - - @Override - public void registerIcons(IIconRegister reg) { - int counter = 0; - for (String s : HeatVent.RESOURCE_NAMES) { - icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s); - } - for (String s : HeatExchanger.RESOURCE_NAME) { - icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s); - } - for (String s : FuelRod.RESOURCE_NAME) { - icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s); - } - for (String s : FuelRod.RESOURCE_NAME_DEPLETED) { - icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s); - } - for (String s : NeutronReflector.RESOURCE_NAME) { - icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s); - } - for (String s : CoolantCell.RESOURCE_NAME) { - icons[counter++] = reg.registerIcon(KekzCore.MODID + ":" + s); - } - } - - @Override - public IIcon getIconFromDamage(int meta) { - return icons[meta]; - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void getSubItems(Item item, CreativeTabs tab, List list) { - for (int i = 0; i < icons.length; i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return super.getUnlocalizedName() + "." + stack.getItemDamage(); - } - - @SuppressWarnings({ "unchecked" }) - @Override - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean b) { - if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { - list.add("Property = 1"); - } else { - list.add("Part for the Modular Nuclear Reactor"); - list.add( - "Hold " + EnumChatFormatting.BOLD - + "[LSHIFT]" - + EnumChatFormatting.RESET - + EnumChatFormatting.GRAY - + " to display properties"); - } - } - - @Override - public double getDurabilityForDisplay(ItemStack stack) { - NBTTagCompound nbt = (stack.getTagCompound() == null) ? new NBTTagCompound() : stack.getTagCompound(); - if (nbt.getInteger("HEALTH") != 0 && nbt.getInteger("MAXHEALTH") != 0) { - return 1 - (double) (nbt.getInteger("HEALTH") / nbt.getInteger("MAXHEALTH")); - } else { - return 0.0d; - } - } - - @Override - public boolean showDurabilityBar(ItemStack stack) { - final int meta = stack.getItemDamage(); - return meta < 31 || meta > 45; - } - - public ItemStack getStackFromDamage(int meta) { - return new ItemStack(getInstance(), 1, meta); - } -} diff --git a/src/main/java/common/reactorItem/AbstractReactorItem.java b/src/main/java/common/reactorItem/AbstractReactorItem.java deleted file mode 100644 index 876d8b4811..0000000000 --- a/src/main/java/common/reactorItem/AbstractReactorItem.java +++ /dev/null @@ -1,29 +0,0 @@ -package common.reactorItem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public abstract class AbstractReactorItem extends Item { - - private final int[] behaviourID; - - protected AbstractReactorItem(int... behaviourID) { - this.behaviourID = behaviourID; - } - - @Override - public abstract double getDurabilityForDisplay(ItemStack stack); - - @Override - public abstract boolean showDurabilityBar(ItemStack stack); - - @Override - public final String getUnlocalizedName(ItemStack stack) { - return super.hasSubtypes ? (super.getUnlocalizedName() + "." + stack.getItemDamage()) - : super.getUnlocalizedName(); - } - - public final int getBehaviourID(int meta) { - return behaviourID[meta]; - } -} diff --git a/src/main/java/common/reactorItem/ReactorItem.java b/src/main/java/common/reactorItem/ReactorItem.java deleted file mode 100644 index 8e69e40e95..0000000000 --- a/src/main/java/common/reactorItem/ReactorItem.java +++ /dev/null @@ -1,47 +0,0 @@ -package common.reactorItem; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ReactorItem extends AbstractReactorItem { - - private static final ReactorItem INSTANCE = new ReactorItem(); - - private final IIcon[] icons = new IIcon[50]; - - private ReactorItem() { - super(); - } - - public static ReactorItem registerItem() { - INSTANCE.setHasSubtypes(true); - INSTANCE.setCreativeTab(CreativeTabs.tabMisc); - INSTANCE.setMaxStackSize(1); - final String unloc = "kekztech_reactor_item"; - INSTANCE.setUnlocalizedName(unloc); - GameRegistry.registerItem(INSTANCE, unloc); - return INSTANCE; - } - - @Override - public void registerIcons(IIconRegister reg) {} - - @Override - public IIcon getIconFromDamage(int meta) { - return icons[meta]; - } - - @Override - public double getDurabilityForDisplay(ItemStack stack) { - return 0; - } - - @Override - public boolean showDurabilityBar(ItemStack stack) { - return false; - } -} diff --git a/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java b/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java deleted file mode 100644 index 1875a097e5..0000000000 --- a/src/main/java/common/tileentities/GTMTE_ModularNuclearReactor.java +++ /dev/null @@ -1,224 +0,0 @@ -package common.tileentities; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.util.ForgeDirection; - -import org.joml.Vector3i; - -import common.Blocks; - -import gregtech.api.GregTech_API; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; - -public class GTMTE_ModularNuclearReactor extends GT_MetaTileEntity_MultiBlockBase { - - private final Block CASING = GregTech_API.sBlockCasings3; - private final int CASING_META = 12; - private final int CASING_TEXTURE_ID = 44; - - private final Block CHAMBER_OFF = Blocks.reactorChamberOFF; - private final Block CHAMBER_ON = Blocks.reactorChamberON; - private final Block CONTROL_ROD = Blocks.reactorControlRod; - - private boolean euMode = true; - - public GTMTE_ModularNuclearReactor(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GTMTE_ModularNuclearReactor(String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) { - return new GTMTE_ModularNuclearReactor(super.mName); - } - - @Override - public String[] getDescription() { - return new String[] { "Disabled" }; - /* - * final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder(); - * b.addInfo("Can be built, BUT DOES NOT WORK") .addInfo("Converts fissile material and outputs power or heat") - * .addSeparator() .addInfo("EU-MODE:") - * .addInfo(" Directly outputs electricity depending on inserted fuel rods") .addSeparator() - * .addInfo("COOLANT-MODE:") .addInfo(" Requires coolant to be pumped into the reactor.") - * .addInfo(" Coolant is heated and should be drained and converted to electricity by other means.") - * .addSeparator() .addInfo("NOTES:") .addInfo(" Does NOT use Industrialcraft 2 reactor components!") - * .addInfo(" Consult controller GUI on how to arrange the outer casings.") .addSeparator() - * .beginStructureBlock(7, 6, 7) .addController("Front bottom Center") - * .addCasingInfo("Radiation Proof Machine Casing", 100) .addOtherStructurePart("Control Rods", - * "Four pillars, four blocks high each. Diagonal to the inner edges of the shell") - * .addOtherStructurePart("Nuclear Reactor Chamber", - * "17 of them to fill out the rest of the floor inside the shell") - * .addDynamoHatch("ONLY in EU-mode, at least one") .addOtherStructurePart("Input Bus, Output Bus", - * "Optional but required for automation") .addOtherStructurePart("Input Hatch, Output Hatch", - * "ONLY in Coolant-Mode, at least one each") .signAndFinalize("Kekzdealer"); - * if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { return b.getInformation(); } else { return - * b.getStructureInformation(); } - */ - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int colorIndex, final boolean aActive, final boolean aRedstone) { - return side == facing - ? new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID), - new GT_RenderedTexture( - aActive ? Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER_ACTIVE - : Textures.BlockIcons.OVERLAY_FRONT_HEAT_EXCHANGER) } - : new ITexture[] { Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID) }; - } - - @Override - public boolean isCorrectMachinePart(ItemStack stack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack stack) { - return false; - } - - @Override - public void onPostTick(IGregTechTileEntity thisController, long aTick) { - super.onPostTick(thisController, aTick); - - if (super.getBaseMetaTileEntity().isActive()) { - // Switch to ON blocks - } else { - // Switch to OFF blocks - } - } - - @Override - public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) { - // Figure out the vector for the direction the back face of the controller is facing - final int dirX = thisController.getBackFacing().offsetX; - final int dirZ = thisController.getBackFacing().offsetZ; - int minCasingAmount = 100; - boolean checklist = true; // if this is still true at the end, machine is good to go :) - - // Determine the ground level center of the structure - final Vector3i center = new Vector3i( - thisController.getXCoord(), - thisController.getYCoord(), - thisController.getZCoord()).add(dirX * 3, 0, dirZ * 3); - // Scan for outer tube - // - Scan sides - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - // Only scan the three wide even sides, skip rest - if ((Math.abs(x) <= 1 && Math.abs(z) == 3) || (Math.abs(z) <= 1 && Math.abs(x) == 3)) { - for (int h = 0; h < 6; h++) { - final Vector3i pos = new Vector3i(center.x() + x, center.y() + h, center.z() + z); - if (h == 0 && pos.x() == thisController.getXCoord() - && pos.y() == thisController.getYCoord() - && pos.z() == thisController.getZCoord()) { - // Ignore controller - continue; - } else if (thisController.getBlock(pos.x(), pos.y(), pos.z()) == CASING - && thisController.getMetaID(pos.x(), pos.y(), pos.z()) == CASING_META) { - minCasingAmount--; - } else { - checklist = false; - } - } - } - } - } - // - Scan corners of tube - for (int x = -2; x <= 2; x++) { - for (int z = -2; z <= 2; z++) { - // Only scan the four corners, skip rest - if (Math.abs(x) + Math.abs(z) == 4) { - for (int h = 0; h < 6; h++) { - final Vector3i pos = new Vector3i(center.x() + x, center.y() + h, center.z() + z); - if (h == 0 && pos.x() == thisController.getXCoord() - && pos.y() == thisController.getYCoord() - && pos.z() == thisController.getZCoord()) { - // Ignore controller - continue; - } else if (thisController.getBlock(pos.x(), pos.y(), pos.z()) == CASING - && thisController.getMetaID(pos.x(), pos.y(), pos.z()) == CASING_META) { - minCasingAmount--; - } else { - checklist = false; - } - } - } - } - } - // Scan ground layer - for (int x = -2; x <= 2; x++) { - for (int z = -2; z <= 2; z++) { - if (!(thisController.getBlock(center.x() + x, center.y(), center.z() + z) == CASING - && thisController.getMetaID(center.x() + x, center.y(), center.z() + z) == CASING_META)) { - checklist = false; - } else { - minCasingAmount--; - } - } - } - // Scan reactor chambers - for (int x = -2; x <= 2; x++) { - for (int z = -2; z <= 2; z++) { - // Skip if diagonal, don't skip center - if (Math.abs(x) == Math.abs(z) && !(x == 0 && z == 0)) { - continue; - } - if (!(thisController.getBlock(center.x() + x, center.y() + 1, center.z() + z) == CHAMBER_OFF - || thisController.getBlock(center.x() + x, center.y() + 1, center.z() + z) == CHAMBER_ON)) { - checklist = false; - } - } - } - // Scan control rods - for (int h = 1; h < 5; h++) { - for (int x = -1; x <= 1; x++) { - for (int z = -1; z <= 1; z++) { - // Only check diagonal - if (x == 0 || z == 0) { - continue; - } - if (!(thisController.getBlock(center.x() + x, center.y() + h, center.z() + z) == CONTROL_ROD)) { - checklist = false; - } - } - } - } - - if (minCasingAmount > 0) { - checklist = false; - } - - return checklist; - } - - @Override - public int getMaxEfficiency(ItemStack stack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack stack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack stack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack stack) { - return false; - } -} diff --git a/src/main/java/common/tileentities/GTMTE_SpaceElevator.java b/src/main/java/common/tileentities/GTMTE_SpaceElevator.java deleted file mode 100644 index 421a2e2760..0000000000 --- a/src/main/java/common/tileentities/GTMTE_SpaceElevator.java +++ /dev/null @@ -1,260 +0,0 @@ -package common.tileentities; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.ForgeDirection; - -import common.Blocks; - -import gregtech.api.enums.Dyes; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gregtech.api.objects.GT_RenderedTexture; -import util.Vector3i; -import util.Vector3ic; - -public class GTMTE_SpaceElevator extends GT_MetaTileEntity_MultiBlockBase { - - private static final Block BASE_BLOCK = Blocks.spaceElevatorStructure; - private static final Block CAP_BLOCK = Blocks.spaceElevatorCapacitor; - private static final Block TETHER_BLOCK = Blocks.spaceElevatorTether; - private static final int BASE_META = 0; - private static final int COIL_HOLDER_META = 1; - private static final String glassNameBorosilicate = "BW_GlasBlocks"; - private static final int HATCH_OVERLAY_ID = 16; - - // Scan positions for capacitor banks - // Start with top left bank, clockwise - // Start with top middle pillar within bank, clockwise, middle last - private static final int[] bankOffsetsX = { -7, 5, 5, -7 }; - private static final int[] bankOffsetsY = { -7, -7, 5, 5 }; - private static final int[] scanOffsetsX = { 1, 2, 1, 0, 1 }; - private static final int[] scanOffsetsY = { 0, 1, 2, 1, 1 }; - - private final HashSet<TE_SpaceElevatorCapacitor> capacitors = new HashSet<>(); - private long lastLaunchEUCost = 0; - - public GTMTE_SpaceElevator(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - } - - public GTMTE_SpaceElevator(String aName) { - super(aName); - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity var1) { - return new GTMTE_SpaceElevator((super.mName)); - } - - @Override - public String[] getDescription() { - return new String[] { "Disabled" }; - /* - * final MultiBlockTooltipBuilder b = new MultiBlockTooltipBuilder(); - * b.addInfo("Access for your Space Station!") - * .addInfo("Check out the wiki on my github if you are having trouble with the structure") - * .addInfo("Regenerative Breaking will recover up to X% of the energy spent on launch") - * .addInfo("Energy recovered depends on coil tier: +10% per coil tier, up to 90%") .addSeparator() - * .beginStructureBlock(15, 11, 15) .addController("Bottom Center") - * .addEnergyHatch("Instead of any casing in the bottom floor") - * .addMaintenanceHatch("Instead of any casing in the bottom floor") - * .addCasingInfo("Solid Steel Machine Casing", 320) .addOtherStructurePart("Any EBF coil", - * "40x, have to be all the same") .addOtherStructurePart("Space Elevator Tether", "4x") - * .addOtherStructurePart("Space Elevator Cabin Block", "42x") - * .addOtherStructurePart("Space Elevator Cabin Guide", "8x") .signAndFinalize("Kekzdealer"); - * if(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { return b.getInformation(); } else { return - * b.getStructureInformation(); } - */ - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing, - int colorIndex, boolean aActive, boolean aRedstone) { - ITexture[] sTexture = new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; - if (side == facing && aActive) { - sTexture = new ITexture[] { new GT_RenderedTexture( - Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW, - Dyes.getModulation(-1, Dyes._NULL.mRGBa)) }; - } - return sTexture; - } - - @Override - public boolean isCorrectMachinePart(ItemStack stack) { - return true; - } - - @Override - public boolean checkRecipe(ItemStack stack) { - this.mProgresstime = 1; - this.mMaxProgresstime = 1; - this.mEUt = 0; - this.mEfficiencyIncrease = 10000; - return true; - } - - public Vector3ic rotateOffsetVector(Vector3ic forgeDirection, int x, int y, int z) { - final Vector3i offset = new Vector3i(0, 0, 0); - // either direction on y-axis - if (forgeDirection.y() == -1) { - offset.x = x; - offset.y = z; - offset.z = y; - } - - return offset; - } - - @Override - public boolean checkMachine(IGregTechTileEntity thisController, ItemStack guiSlotItem) { - // Make sure the controller is either facing up or down - if (thisController.getFrontFacing().offsetY != 0) { - return false; - } - - // Figure out the vector for the direction the back face of the controller is facing - final Vector3ic forgeDirection = new Vector3i( - thisController.getBackFacing().offsetX, - thisController.getBackFacing().offsetY, - thisController.getBackFacing().offsetZ); - boolean formationChecklist = true; - int minCasingAmount = 320; - int firstCoilMeta = -1; - capacitors.clear(); - - // Base floor - for (int X = -7; X <= 7; X++) { - for (int Y = -7; Y <= 7; Y++) { - if (X == 0 && Y == 0) { - continue; // Skip controller - } - - final Vector3ic offset = rotateOffsetVector(forgeDirection, X, Y, 0); - final IGregTechTileEntity currentTE = thisController - .getIGregTechTileEntityOffset(offset.x(), offset.y(), offset.z()); - - // Tries to add TE as either of those kinds of hatches. - // The number is the texture index number for the texture that needs to be painted over the hatch - // texture - if (!super.addMaintenanceToMachineList(currentTE, HATCH_OVERLAY_ID) - && !this.addEnergyInputToMachineList(currentTE, HATCH_OVERLAY_ID)) { - - // If it's not a hatch, is it the right casing for this machine? Check block and block meta. - if ((thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == BASE_BLOCK) - && (thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == BASE_META)) { - // Seems to be valid casing. Decrement counter. - minCasingAmount--; - } else { - formationChecklist = false; - } - } - } - } - System.out.println(""); - // Capacitor banks - for (int bank = 0; bank < 4; bank++) { - for (int Z = 1; Z <= 5; Z++) { - for (int scan = 0; scan < 5; scan++) { - final Vector3ic offset = rotateOffsetVector( - forgeDirection, - bankOffsetsX[bank] + scanOffsetsX[scan], - bankOffsetsY[bank] + scanOffsetsY[scan], - Z); - if (Z == 1 || Z == 5) { - // Check for casings - if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == BASE_BLOCK - && thisController.getMetaIDOffset(offset.x(), offset.y(), offset.z()) == BASE_META) { - minCasingAmount--; - } else { - formationChecklist = false; - } - } else { - if (scan == 4) { - // Check for capacitors - final TileEntity te = thisController - .getTileEntityOffset(offset.x(), offset.y(), offset.z()); - if (thisController.getBlockOffset(offset.x(), offset.y(), offset.z()) == CAP_BLOCK - && te instanceof TE_SpaceElevatorCapacitor) { - capacitors.add((TE_SpaceElevatorCapacitor) te); - } else { - formationChecklist = false; - } - } else { - // Check for Glass - if (!thisController.getBlockOffset(offset.x(), offset.y(), offset.z()).getUnlocalizedName() - .equals(glassNameBorosilicate)) { - formationChecklist = false; - } - } - } - } - } - } - // Anchor - - // Coil holders - - // Coils - - if (minCasingAmount > 0) { - formationChecklist = false; - } - - for (TE_SpaceElevatorCapacitor cap : capacitors) { - cap.setIsDamaged(false); - } - - return formationChecklist; - } - - @Override - public String[] getInfoData() { - final ArrayList<String> ll = new ArrayList<>(); - ll.add(EnumChatFormatting.YELLOW + "Operational Data:" + EnumChatFormatting.RESET); - - ll.add( - "Maintenance Status: " + ((super.getRepairStatus() == super.getIdealStatus()) - ? EnumChatFormatting.GREEN + "Working perfectly" + EnumChatFormatting.RESET - : EnumChatFormatting.RED + "Has Problems" + EnumChatFormatting.RESET)); - ll.add("---------------------------------------------"); - - final String[] a = new String[ll.size()]; - return ll.toArray(a); - } - - @Override - public boolean isGivingInformation() { - return true; - } - - @Override - public int getMaxEfficiency(ItemStack stack) { - return 10000; - } - - @Override - public int getPollutionPerTick(ItemStack stack) { - return 0; - } - - @Override - public int getDamageToComponent(ItemStack stack) { - return 0; - } - - @Override - public boolean explodesOnComponentBreak(ItemStack stack) { - return false; - } -} diff --git a/src/main/java/common/tileentities/TE_BeamTransmitter.java b/src/main/java/common/tileentities/TE_BeamTransmitter.java deleted file mode 100644 index e8999e393f..0000000000 --- a/src/main/java/common/tileentities/TE_BeamTransmitter.java +++ /dev/null @@ -1,49 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; - -import org.joml.Vector3i; -import org.joml.Vector3ic; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TE_BeamTransmitter extends TileEntity { - - private final Vector3ic position; - - private final Vector3ic target = new Vector3i(10, 20, 10); - private double distanceCache; - private boolean distanceCacheValid = false; - - public TE_BeamTransmitter() { - position = new Vector3i(super.xCoord, super.yCoord, super.zCoord); - } - - public Vector3ic getTargetPosition() { - return target; - } - - public double getDistanceFromTarget() { - if (!distanceCacheValid) { - distanceCache = position.distance(target); - distanceCacheValid = true; - } - return distanceCache; - } - - @SideOnly(Side.CLIENT) - @Override - public double getMaxRenderDistanceSquared() { - // 4k is standard, 65k is what the vanilla beacon uses - return 65536.0D; - } - - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getRenderBoundingBox() { - // Make it so the beam is still rendered even when the source block is out of sight - return INFINITE_EXTENT_AABB; - } -} diff --git a/src/main/java/common/tileentities/TE_ItemProxyCable.java b/src/main/java/common/tileentities/TE_ItemProxyCable.java deleted file mode 100644 index 1dc539c89e..0000000000 --- a/src/main/java/common/tileentities/TE_ItemProxyCable.java +++ /dev/null @@ -1,155 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class TE_ItemProxyCable extends TileEntity { - - private static final float THICKNESS = 0.5F; - private byte connections = 0; - private byte connectionAllowed = 63; - private String idCache = null; - - public TE_ItemProxyCable() {} - - @Override - public void updateEntity() { - // Check all 6 sides and connect the conduit if it is allowed to - for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { - final TileEntity te = super.getWorldObj().getTileEntity( - super.xCoord + side.offsetX, - super.yCoord + side.offsetY, - super.zCoord + side.offsetZ); - if (te instanceof TE_ItemProxyCable) { - final TE_ItemProxyCable cable = (TE_ItemProxyCable) te; - setConnection(side, cable.isConnectionAllowed(side.getOpposite())); - } else { - setConnection(side, false); - } - } - } - - public static float getThickness() { - return THICKNESS; - } - - /** - * Builds a simple unique identifier for this TileEntity by appending the x, y, and z coordinates in a string. - * - * @return unique identifier for this TileEntity - */ - public String getIdentifier() { - if (idCache == null) { - idCache = "" + super.xCoord + super.yCoord + super.zCoord; - return idCache; - } else { - return idCache; - } - } - - /** - * 0 0 0 0 0 0 0 0 = 0 -> no connection </br> - * 0 0 0 0 0 0 0 1 = 1 -> down </br> - * 0 0 0 0 0 0 1 0 = 2 -> up </br> - * 0 0 0 0 0 1 0 0 = 4 -> north </br> - * 0 0 0 0 1 0 0 0 = 8 -> south </br> - * 0 0 0 1 0 0 0 0 = 16 -> west </br> - * 0 0 1 0 0 0 0 0 = 32 -> east </br> - * - * @param side The side for which to set the connection status. - * @param connected Whether this side should be connected or not - * @return True if the connection was allowed - */ - public boolean setConnection(ForgeDirection side, boolean connected) { - if (isConnectionAllowed(side)) { - switch (side) { - case DOWN: - connections = (byte) ((connected) ? connections | 1 : connections ^ 1); - break; - case UP: - connections = (byte) ((connected) ? connections | 2 : connections ^ 2); - break; - case NORTH: - connections = (byte) ((connected) ? connections | 4 : connections ^ 4); - break; - case SOUTH: - connections = (byte) ((connected) ? connections | 8 : connections ^ 8); - break; - case WEST: - connections = (byte) ((connected) ? connections | 16 : connections ^ 16); - break; - case EAST: - connections = (byte) ((connected) ? connections | 32 : connections ^ 32); - break; - default: - return false; - } - return true; - } else { - return false; - } - } - - public boolean isConnected(ForgeDirection side) { - switch (side) { - case DOWN: - return (connections & 1) == 1; - case UP: - return (connections & 2) == 2; - case NORTH: - return (connections & 4) == 4; - case SOUTH: - return (connections & 8) == 8; - case WEST: - return (connections & 16) == 16; - case EAST: - return (connections & 32) == 32; - default: - return false; - } - } - - public void setConnectionAllowed(ForgeDirection side, boolean allowed) { - switch (side) { - case DOWN: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 1 : connectionAllowed ^ 1); - break; - case UP: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 2 : connectionAllowed ^ 2); - break; - case NORTH: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 4 : connectionAllowed ^ 4); - break; - case SOUTH: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 8 : connectionAllowed ^ 8); - break; - case WEST: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 16 : connectionAllowed ^ 16); - break; - case EAST: - connectionAllowed = (byte) ((allowed) ? connectionAllowed | 32 : connectionAllowed ^ 32); - break; - default: - break; - } - } - - public boolean isConnectionAllowed(ForgeDirection side) { - switch (side) { - case DOWN: - return (connectionAllowed & 1) == 1; - case UP: - return (connectionAllowed & 2) == 2; - case NORTH: - return (connectionAllowed & 4) == 4; - case SOUTH: - return (connectionAllowed & 8) == 8; - case WEST: - return (connectionAllowed & 16) == 16; - case EAST: - return (connectionAllowed & 32) == 32; - default: - return false; - } - } -} diff --git a/src/main/java/common/tileentities/TE_ItemProxyEndpoint.java b/src/main/java/common/tileentities/TE_ItemProxyEndpoint.java deleted file mode 100644 index 7d58a21c61..0000000000 --- a/src/main/java/common/tileentities/TE_ItemProxyEndpoint.java +++ /dev/null @@ -1,175 +0,0 @@ -package common.tileentities; - -import java.util.HashSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class TE_ItemProxyEndpoint extends TileEntity implements ISidedInventory { - - private byte channel = -1; - private IInventory proxyInventory = null; - private int tickCounter = 0; - - public TE_ItemProxyEndpoint() { - channel = 0; - } - - public void setChannel(byte channel) { - this.channel = channel; - } - - public int getChannel() { - return channel; - } - - @Override - public void updateEntity() { - if (tickCounter == 20) { - if (channel != -1) { - proxyInventory = searchSource(); - } - tickCounter = 0; - } - tickCounter++; - } - - private TE_ItemProxySource searchSource() { - - final HashSet<TE_ItemProxySource> sources = new HashSet<>(); - final HashSet<String> visited = new HashSet<>(); - - for (ForgeDirection next : ForgeDirection.VALID_DIRECTIONS) { - final TileEntity te = super.getWorldObj().getTileEntity( - super.xCoord + next.offsetX, - super.yCoord + next.offsetY, - super.zCoord + next.offsetZ); - if (te instanceof TE_ItemProxyCable) { - final TE_ItemProxyCable cable = (TE_ItemProxyCable) te; - if (cable.isConnected(next.getOpposite())) { - searchSourceRecursive(sources, visited, next.getOpposite(), cable); - } - } - } - - if (sources.isEmpty()) { - return null; - } else { - return sources.iterator().next(); - } - } - - private void searchSourceRecursive(HashSet<TE_ItemProxySource> sources, HashSet<String> visited, - ForgeDirection from, TE_ItemProxyCable nextTarget) { - - if (!visited.contains(nextTarget.getIdentifier())) { - visited.add(nextTarget.getIdentifier()); - - for (ForgeDirection next : ForgeDirection.VALID_DIRECTIONS) { - if (next != from) { - final TileEntity te = super.getWorldObj().getTileEntity( - nextTarget.xCoord + next.offsetX, - nextTarget.yCoord + next.offsetY, - nextTarget.zCoord + next.offsetZ); - if (te instanceof TE_ItemProxyCable) { - final TE_ItemProxyCable cable = (TE_ItemProxyCable) te; - if (cable.isConnected(next.getOpposite())) { - searchSourceRecursive(sources, visited, next.getOpposite(), cable); - } - } else if (te instanceof TE_ItemProxySource) { - sources.add((TE_ItemProxySource) te); - } - } - } - } - } - - @Override - public int getSizeInventory() { - return 1; - } - - @Override - public ItemStack getStackInSlot(int slot) { - if (proxyInventory != null && slot == 0) { - return proxyInventory.getStackInSlot(channel); - } else { - return null; - } - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - if (proxyInventory != null && slot == 0) { - return proxyInventory.decrStackSize(channel, amount); - } else { - return null; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return (proxyInventory != null) ? proxyInventory.getStackInSlotOnClosing(channel) : null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - if (proxyInventory != null && slot == 0) { - proxyInventory.setInventorySlotContents(channel, itemStack); - } - } - - @Override - public String getInventoryName() { - return (proxyInventory != null) ? "Connected: " + proxyInventory.getInventoryName() : "Untethered Proxy"; - } - - @Override - public boolean hasCustomInventoryName() { - return true; - } - - @Override - public int getInventoryStackLimit() { - return (proxyInventory != null) ? proxyInventory.getInventoryStackLimit() : 0; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - if (proxyInventory != null && slot == 0) { - return proxyInventory.isItemValidForSlot(channel, itemStack); - } else { - return false; - } - } - - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return new int[] { 0 }; - } - - @Override - public boolean canInsertItem(int slot, ItemStack itemStack, int side) { - return isItemValidForSlot(slot, itemStack); - } - - @Override - public boolean canExtractItem(int slot, ItemStack itemStack, int side) { - return slot == 0; - } -} diff --git a/src/main/java/common/tileentities/TE_ItemProxySource.java b/src/main/java/common/tileentities/TE_ItemProxySource.java deleted file mode 100644 index 31403f5352..0000000000 --- a/src/main/java/common/tileentities/TE_ItemProxySource.java +++ /dev/null @@ -1,105 +0,0 @@ -package common.tileentities; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class TE_ItemProxySource extends TileEntity implements IInventory { - - private final ItemStack[] slots = new ItemStack[16]; - private String idCache = null; - - /** - * Builds a simple unique identifier for this TileEntity by appending the x, y, and z coordinates in a string. - * - * @return unique identifier for this TileEntity - */ - public String getIdentifier() { - if (idCache == null) { - idCache = "" + super.xCoord + super.yCoord + super.zCoord; - return idCache; - } else { - return idCache; - } - } - - @Override - public int getSizeInventory() { - return slots.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return slots[slot]; - } - - @Override - public ItemStack decrStackSize(int slot, int amount) { - if (slots[slot] != null) { - - ItemStack copy; - - if (slots[slot].stackSize == amount) { - copy = slots[slot]; - slots[slot] = null; - super.markDirty(); - return copy; - } else { - copy = slots[slot].splitStack(amount); - if (slots[slot].stackSize == 0) { - slots[slot] = null; - } - return copy; - } - - } else { - return null; - } - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - return null; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack itemStack) { - slots[slot] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) { - itemStack.stackSize = getInventoryStackLimit(); - } - super.markDirty(); - } - - @Override - public String getInventoryName() { - return "Item Proxy Source"; - } - - @Override - public boolean hasCustomInventoryName() { - return true; - } - - @Override - public int getInventoryStackLimit() { - return 64; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer p_70300_1_) { - return true; - } - - @Override - public void openInventory() {} - - @Override - public void closeInventory() {} - - @Override - public boolean isItemValidForSlot(int slot, ItemStack itemStack) { - return true; - } -} diff --git a/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java b/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java deleted file mode 100644 index ea5211bfba..0000000000 --- a/src/main/java/common/tileentities/TE_SpaceElevatorCapacitor.java +++ /dev/null @@ -1,53 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; - -public class TE_SpaceElevatorCapacitor extends TileEntity { - - private float chargeLevel = 0.0F; - private boolean isDamaged = true; - - /** - * Called by {@link GTMTE_SpaceElevator} while charging - * - * @param charge Current elevator charge - * @param maxCharge Charge level it is trying to reach - */ - public void updateChargeLevel(int charge, int maxCharge) { - chargeLevel = ((float) charge) / ((float) maxCharge); - } - - /** - * Called by {@link client.renderer.TESR_SECapacitor} to calculate the block's colour saturation - * - * @return Charge level from 0.0F to 1.0F - */ - public float getChargeLevel() { - return chargeLevel; - } - - /** - * Called by {@link GTMTE_SpaceElevator} in case of power loss - */ - public void resetChargeLevel() { - chargeLevel = 0.0F; - } - - /** - * Called by {@link GTMTE_SpaceElevator} in case of maintenance issues - * - * @param isDamaged has maintenance issue - */ - public void setIsDamaged(boolean isDamaged) { - this.isDamaged = isDamaged; - } - - /** - * Called by {@link client.renderer.TESR_SECapacitor} to check whether the block should be rendered red - * - * @return should be rendered red - */ - public boolean isDamaged() { - return isDamaged; - } -} diff --git a/src/main/java/common/tileentities/TE_SpaceElevatorTether.java b/src/main/java/common/tileentities/TE_SpaceElevatorTether.java deleted file mode 100644 index 7e76a9c14d..0000000000 --- a/src/main/java/common/tileentities/TE_SpaceElevatorTether.java +++ /dev/null @@ -1,24 +0,0 @@ -package common.tileentities; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TE_SpaceElevatorTether extends TileEntity { - - @SideOnly(Side.CLIENT) - @Override - public double getMaxRenderDistanceSquared() { - // 4k is standard, 65k is what the vanilla beacon uses - return 65536.0D; - } - - @Override - @SideOnly(Side.CLIENT) - public AxisAlignedBB getRenderBoundingBox() { - // Make it so the beam is still rendered even when the source block is out of sight - return INFINITE_EXTENT_AABB; - } -} |