From 047625389d0045bc60421ec75d7439c063c02927 Mon Sep 17 00:00:00 2001 From: gigabit101 Date: Sat, 20 Feb 2016 03:07:56 +0000 Subject: [PATCH] Added compressor, extractor, electric furnace --- .../api/recipe/machines/CompressorRecipe.java | 25 ++ .../api/recipe/machines/ExtractorRecipe.java | 25 ++ .../machine/BlockImplosionCompressor.java | 2 +- .../blocks/teir1/BlockCompresser.java | 62 +++++ .../blocks/teir1/BlockElectricFurnace.java | 62 +++++ .../blocks/teir1/BlockExtractor.java | 62 +++++ .../java/techreborn/client/GuiHandler.java | 24 +- .../client/container/ContainerCompressor.java | 65 +++++ .../container/ContainerElectricFurnace.java | 66 +++++ .../client/container/ContainerExtractor.java | 65 +++++ .../techreborn/client/gui/GuiCompressor.java | 52 ++++ .../client/gui/GuiElectricFurnace.java | 58 +++++ .../techreborn/client/gui/GuiExtractor.java | 56 +++++ src/main/java/techreborn/init/ModBlocks.java | 21 ++ src/main/java/techreborn/init/ModRecipes.java | 4 +- src/main/java/techreborn/lib/Reference.java | 2 + .../tiles/teir1/TileCompressor.java | 232 ++++++++++++++++++ .../tiles/teir1/TileElectricFurnace.java | 232 ++++++++++++++++++ .../techreborn/tiles/teir1/TileExtractor.java | 232 ++++++++++++++++++ .../assets/techreborn/lang/en_US.lang | 3 + .../techreborn/textures/gui/compressor.png | Bin 0 -> 2274 bytes 21 files changed, 1345 insertions(+), 5 deletions(-) create mode 100644 src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java create mode 100644 src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java create mode 100644 src/main/java/techreborn/blocks/teir1/BlockCompresser.java create mode 100644 src/main/java/techreborn/blocks/teir1/BlockElectricFurnace.java create mode 100644 src/main/java/techreborn/blocks/teir1/BlockExtractor.java create mode 100644 src/main/java/techreborn/client/container/ContainerCompressor.java create mode 100644 src/main/java/techreborn/client/container/ContainerElectricFurnace.java create mode 100644 src/main/java/techreborn/client/container/ContainerExtractor.java create mode 100644 src/main/java/techreborn/client/gui/GuiCompressor.java create mode 100644 src/main/java/techreborn/client/gui/GuiElectricFurnace.java create mode 100644 src/main/java/techreborn/client/gui/GuiExtractor.java create mode 100644 src/main/java/techreborn/tiles/teir1/TileCompressor.java create mode 100644 src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java create mode 100644 src/main/java/techreborn/tiles/teir1/TileExtractor.java create mode 100644 src/main/resources/assets/techreborn/textures/gui/compressor.png diff --git a/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java b/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java new file mode 100644 index 000000000..1c2c85b9c --- /dev/null +++ b/src/main/java/techreborn/api/recipe/machines/CompressorRecipe.java @@ -0,0 +1,25 @@ +package techreborn.api.recipe.machines; + + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidStack; +import techreborn.api.recipe.BaseRecipe; +import techreborn.lib.Reference; +import techreborn.tiles.TileIndustrialGrinder; + +public class CompressorRecipe extends BaseRecipe { + + public CompressorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) { + super(Reference.compressorRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (output1 != null) + addOutput(output1); + } + + @Override + public String getUserFreindlyName() { + return "Compressor"; + } +} diff --git a/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java b/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java new file mode 100644 index 000000000..d983f8e64 --- /dev/null +++ b/src/main/java/techreborn/api/recipe/machines/ExtractorRecipe.java @@ -0,0 +1,25 @@ +package techreborn.api.recipe.machines; + + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidStack; +import techreborn.api.recipe.BaseRecipe; +import techreborn.lib.Reference; +import techreborn.tiles.TileIndustrialGrinder; + +public class ExtractorRecipe extends BaseRecipe { + + public ExtractorRecipe(ItemStack input1, ItemStack output1, int tickTime, int euPerTick) { + super(Reference.extractorRecipe, tickTime, euPerTick); + if (input1 != null) + inputs.add(input1); + if (output1 != null) + addOutput(output1); + } + + @Override + public String getUserFreindlyName() { + return "Extractor"; + } +} diff --git a/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java b/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java index 26ad1dd29..c620fec5c 100644 --- a/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java +++ b/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java @@ -27,7 +27,7 @@ public class BlockImplosionCompressor extends BlockMachineBase implements IRotat public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if (!player.isSneaking()) - player.openGui(Core.INSTANCE, GuiHandler.compresserID, world, x, y, + player.openGui(Core.INSTANCE, GuiHandler.implosionCompresserID, world, x, y, z); return true; } diff --git a/src/main/java/techreborn/blocks/teir1/BlockCompresser.java b/src/main/java/techreborn/blocks/teir1/BlockCompresser.java new file mode 100644 index 000000000..2f415e5ac --- /dev/null +++ b/src/main/java/techreborn/blocks/teir1/BlockCompresser.java @@ -0,0 +1,62 @@ +package techreborn.blocks.teir1; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import techreborn.Core; +import techreborn.blocks.BlockMachineBase; +import techreborn.blocks.IRotationTexture; +import techreborn.client.GuiHandler; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileCompressor; +import techreborn.tiles.teir1.TileGrinder; + +public class BlockCompresser extends BlockMachineBase implements IRotationTexture{ + + public BlockCompresser(Material material) { + super(material); + setUnlocalizedName("techreborn.compresser"); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileCompressor(); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if (!player.isSneaking()){ + player.openGui(Core.INSTANCE, GuiHandler.compressorID, world, x, y, z); + } + return true; + } + + private final String prefix = "techreborn:blocks/machine/"; + + @Override + public String getFrontOff() { + return prefix + "machine_side"; + } + + @Override + public String getFrontOn() { + return prefix + "machine_side"; + } + + @Override + public String getSide() { + return prefix + "machine_side"; + } + + @Override + public String getTop() { + return prefix + "machine_side"; + } + + @Override + public String getBottom() { + return prefix + "machine_side"; + } +} diff --git a/src/main/java/techreborn/blocks/teir1/BlockElectricFurnace.java b/src/main/java/techreborn/blocks/teir1/BlockElectricFurnace.java new file mode 100644 index 000000000..826dec34e --- /dev/null +++ b/src/main/java/techreborn/blocks/teir1/BlockElectricFurnace.java @@ -0,0 +1,62 @@ +package techreborn.blocks.teir1; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import techreborn.Core; +import techreborn.blocks.BlockMachineBase; +import techreborn.blocks.IRotationTexture; +import techreborn.client.GuiHandler; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileGrinder; + +public class BlockElectricFurnace extends BlockMachineBase implements IRotationTexture{ + + public BlockElectricFurnace(Material material) { + super(material); + setUnlocalizedName("techreborn.electricfurnace"); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileElectricFurnace(); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if (!player.isSneaking()){ + player.openGui(Core.INSTANCE, GuiHandler.electricFurnaceID, world, x, y, z); + } + return true; + } + + private final String prefix = "techreborn:blocks/machine/"; + + @Override + public String getFrontOff() { + return prefix + "machine_side"; + } + + @Override + public String getFrontOn() { + return prefix + "machine_side"; + } + + @Override + public String getSide() { + return prefix + "machine_side"; + } + + @Override + public String getTop() { + return prefix + "machine_side"; + } + + @Override + public String getBottom() { + return prefix + "machine_side"; + } +} diff --git a/src/main/java/techreborn/blocks/teir1/BlockExtractor.java b/src/main/java/techreborn/blocks/teir1/BlockExtractor.java new file mode 100644 index 000000000..7a7f192f1 --- /dev/null +++ b/src/main/java/techreborn/blocks/teir1/BlockExtractor.java @@ -0,0 +1,62 @@ +package techreborn.blocks.teir1; + +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import techreborn.Core; +import techreborn.blocks.BlockMachineBase; +import techreborn.blocks.IRotationTexture; +import techreborn.client.GuiHandler; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileExtractor; +import techreborn.tiles.teir1.TileGrinder; + +public class BlockExtractor extends BlockMachineBase implements IRotationTexture{ + + public BlockExtractor(Material material) { + super(material); + setUnlocalizedName("techreborn.extractor"); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileExtractor(); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + if (!player.isSneaking()){ + player.openGui(Core.INSTANCE, GuiHandler.extractorID, world, x, y, z); + } + return true; + } + + private final String prefix = "techreborn:blocks/machine/"; + + @Override + public String getFrontOff() { + return prefix + "machine_side"; + } + + @Override + public String getFrontOn() { + return prefix + "machine_side"; + } + + @Override + public String getSide() { + return prefix + "machine_side"; + } + + @Override + public String getTop() { + return prefix + "machine_side"; + } + + @Override + public String getBottom() { + return prefix + "machine_side"; + } +} diff --git a/src/main/java/techreborn/client/GuiHandler.java b/src/main/java/techreborn/client/GuiHandler.java index 236b51486..aa245c8b9 100644 --- a/src/main/java/techreborn/client/GuiHandler.java +++ b/src/main/java/techreborn/client/GuiHandler.java @@ -15,6 +15,9 @@ import techreborn.tiles.generator.TileGenerator; import techreborn.tiles.generator.TileSemifluidGenerator; import techreborn.tiles.idsu.TileIDSU; import techreborn.tiles.lesu.TileLesu; +import techreborn.tiles.teir1.TileCompressor; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileExtractor; import techreborn.tiles.teir1.TileGrinder; public class GuiHandler implements IGuiHandler { @@ -27,7 +30,7 @@ public class GuiHandler implements IGuiHandler { public static final int blastFurnaceID = 5; public static final int alloySmelterID = 6; public static final int industrialGrinderID = 7; - public static final int compresserID = 8; + public static final int implosionCompresserID = 8; public static final int matterfabID = 9; public static final int pdaID = 10; public static final int chunkloaderID = 11; @@ -49,6 +52,9 @@ public class GuiHandler implements IGuiHandler { public static final int vacuumFreezerID = 30; public static final int grinderID = 31; public static final int generatorID = 32; + public static final int extractorID = 33; + public static final int compressorID = 34; + public static final int electricFurnaceID = 35; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { @@ -85,7 +91,7 @@ public class GuiHandler implements IGuiHandler { } else if (ID == industrialGrinderID) { return new ContainerIndustrialGrinder( (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z)), player); - } else if (ID == compresserID) { + } else if (ID == implosionCompresserID) { return new ContainerImplosionCompressor( (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); } else if (ID == matterfabID) { @@ -133,6 +139,12 @@ public class GuiHandler implements IGuiHandler { return new ContainerGrinder((TileGrinder) world.getTileEntity(new BlockPos(x, y, z)), player); }else if (ID == generatorID) { return new ContainerGenerator((TileGenerator) world.getTileEntity(new BlockPos(x, y, z)), player); + }else if (ID == extractorID) { + return new ContainerExtractor((TileExtractor) world.getTileEntity(new BlockPos(x, y, z)), player); + }else if (ID == compressorID) { + return new ContainerCompressor((TileCompressor) world.getTileEntity(new BlockPos(x, y, z)), player); + }else if (ID == electricFurnaceID) { + return new ContainerElectricFurnace((TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z)), player); } @@ -175,7 +187,7 @@ public class GuiHandler implements IGuiHandler { } else if (ID == industrialGrinderID) { return new GuiIndustrialGrinder(player, (TileIndustrialGrinder) world.getTileEntity(new BlockPos(x, y, z))); - } else if (ID == compresserID) { + } else if (ID == implosionCompresserID) { return new GuiImplosionCompressor(player, (TileImplosionCompressor) world.getTileEntity(new BlockPos(x, y, z))); } else if (ID == matterfabID) { @@ -223,6 +235,12 @@ public class GuiHandler implements IGuiHandler { return new GuiGrinder(player, (TileGrinder) world.getTileEntity(new BlockPos(x, y, z))); }else if (ID == generatorID) { return new GuiGenerator(player, (TileGenerator) world.getTileEntity(new BlockPos(x, y, z))); + }else if (ID == extractorID) { + return new GuiExtractor(player, (TileExtractor) world.getTileEntity(new BlockPos(x, y, z))); + }else if (ID == compressorID) { + return new GuiCompressor(player, (TileCompressor) world.getTileEntity(new BlockPos(x, y, z))); + }else if (ID == electricFurnaceID) { + return new GuiElectricFurnace(player, (TileElectricFurnace) world.getTileEntity(new BlockPos(x, y, z))); } return null; } diff --git a/src/main/java/techreborn/client/container/ContainerCompressor.java b/src/main/java/techreborn/client/container/ContainerCompressor.java new file mode 100644 index 000000000..b12abdd7c --- /dev/null +++ b/src/main/java/techreborn/client/container/ContainerCompressor.java @@ -0,0 +1,65 @@ +package techreborn.client.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import reborncore.client.gui.SlotOutput; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileCompressor; +import techreborn.tiles.teir1.TileGrinder; + +public class ContainerCompressor extends ContainerCrafting { + + EntityPlayer player; + + TileCompressor tile; + + public int connectionStatus; + + public ContainerCompressor(TileCompressor tileGrinder, EntityPlayer player) { + super(tileGrinder.crafter); + tile = tileGrinder; + this.player = player; + + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + + + // upgrades + this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62)); + + int i; + + for (i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, + 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) { + if (id == 10) { + this.connectionStatus = value; + } + } + +} diff --git a/src/main/java/techreborn/client/container/ContainerElectricFurnace.java b/src/main/java/techreborn/client/container/ContainerElectricFurnace.java new file mode 100644 index 000000000..55dd4bfb4 --- /dev/null +++ b/src/main/java/techreborn/client/container/ContainerElectricFurnace.java @@ -0,0 +1,66 @@ +package techreborn.client.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import reborncore.client.gui.SlotOutput; +import reborncore.common.container.RebornContainer; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileGrinder; + +public class ContainerElectricFurnace extends RebornContainer { + + EntityPlayer player; + + TileElectricFurnace tile; + + public int connectionStatus; + + public ContainerElectricFurnace(TileElectricFurnace tileGrinder, EntityPlayer player) { + super(); + tile = tileGrinder; + this.player = player; + + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + + + // upgrades + this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62)); + + int i; + + for (i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, + 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) { + if (id == 10) { + this.connectionStatus = value; + } + } + +} diff --git a/src/main/java/techreborn/client/container/ContainerExtractor.java b/src/main/java/techreborn/client/container/ContainerExtractor.java new file mode 100644 index 000000000..f39ba2f1c --- /dev/null +++ b/src/main/java/techreborn/client/container/ContainerExtractor.java @@ -0,0 +1,65 @@ +package techreborn.client.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import reborncore.client.gui.SlotOutput; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileExtractor; +import techreborn.tiles.teir1.TileGrinder; + +public class ContainerExtractor extends ContainerCrafting { + + EntityPlayer player; + + TileExtractor tile; + + public int connectionStatus; + + public ContainerExtractor(TileExtractor tileGrinder, EntityPlayer player) { + super(tileGrinder.crafter); + tile = tileGrinder; + this.player = player; + + // input + this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 34)); + this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34)); + + + // upgrades + this.addSlotToContainer(new Slot(tileGrinder.inventory, 2, 152, 8)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 3, 152, 26)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 4, 152, 44)); + this.addSlotToContainer(new Slot(tileGrinder.inventory, 5, 152, 62)); + + int i; + + for (i = 0; i < 3; ++i) { + for (int j = 0; j < 9; ++j) { + this.addSlotToContainer(new Slot(player.inventory, j + i * 9 + + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) { + this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, + 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int id, int value) { + if (id == 10) { + this.connectionStatus = value; + } + } + +} diff --git a/src/main/java/techreborn/client/gui/GuiCompressor.java b/src/main/java/techreborn/client/gui/GuiCompressor.java new file mode 100644 index 000000000..de2467ca7 --- /dev/null +++ b/src/main/java/techreborn/client/gui/GuiCompressor.java @@ -0,0 +1,52 @@ +package techreborn.client.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import techreborn.client.container.ContainerCompressor; +import techreborn.tiles.teir1.TileCompressor; + +public class GuiCompressor extends GuiContainer { + + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + + TileCompressor compressor; + ContainerCompressor containerGrinder; + + public GuiCompressor(EntityPlayer player, TileCompressor tilegrinder) { + super(new ContainerCompressor(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + compressor = tilegrinder; + containerGrinder = (ContainerCompressor) this.inventorySlots; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + int j = 0; + + j = compressor.getProgressScaled(24); + if (j > 0) { + this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16); + } + + j = compressor.getEnergyScaled(12); + if (j > 0) { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + String name = StatCollector.translateToLocal("tile.techreborn.compressor.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + +} diff --git a/src/main/java/techreborn/client/gui/GuiElectricFurnace.java b/src/main/java/techreborn/client/gui/GuiElectricFurnace.java new file mode 100644 index 000000000..5d343baa9 --- /dev/null +++ b/src/main/java/techreborn/client/gui/GuiElectricFurnace.java @@ -0,0 +1,58 @@ +package techreborn.client.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import techreborn.client.container.ContainerElectricFurnace; +import techreborn.client.container.ContainerExtractor; +import techreborn.client.container.ContainerGrinder; +import techreborn.client.container.ContainerIndustrialGrinder; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileExtractor; +import techreborn.tiles.teir1.TileGrinder; + +public class GuiElectricFurnace extends GuiContainer { + + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + + TileElectricFurnace furnace; + ContainerElectricFurnace containerGrinder; + + public GuiElectricFurnace(EntityPlayer player, TileElectricFurnace tilegrinder) { + super(new ContainerElectricFurnace(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + furnace = tilegrinder; + containerGrinder = (ContainerElectricFurnace) this.inventorySlots; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + int j = 0; + +// j = furnace.getProgressScaled(24); +// if (j > 0) { +// this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16); +// } + + j = furnace.getEnergyScaled(12); + if (j > 0) { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + String name = StatCollector.translateToLocal("tile.techreborn.electricfurnace.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + +} diff --git a/src/main/java/techreborn/client/gui/GuiExtractor.java b/src/main/java/techreborn/client/gui/GuiExtractor.java new file mode 100644 index 000000000..79730effa --- /dev/null +++ b/src/main/java/techreborn/client/gui/GuiExtractor.java @@ -0,0 +1,56 @@ +package techreborn.client.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; +import techreborn.client.container.ContainerExtractor; +import techreborn.client.container.ContainerGrinder; +import techreborn.client.container.ContainerIndustrialGrinder; +import techreborn.tiles.TileIndustrialGrinder; +import techreborn.tiles.teir1.TileExtractor; +import techreborn.tiles.teir1.TileGrinder; + +public class GuiExtractor extends GuiContainer { + + public static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/compressor.png"); + + TileExtractor extractor; + ContainerExtractor containerGrinder; + + public GuiExtractor(EntityPlayer player, TileExtractor tilegrinder) { + super(new ContainerExtractor(tilegrinder, player)); + this.xSize = 176; + this.ySize = 167; + extractor = tilegrinder; + containerGrinder = (ContainerExtractor) this.inventorySlots; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + int j = 0; + + j = extractor.getProgressScaled(24); + if (j > 0) { + this.drawTexturedModalRect(k + 50, l + 36, 176, 14, j + 1, 16); + } + + j = extractor.getEnergyScaled(12); + if (j > 0) { + this.drawTexturedModalRect(k + 24, l + 36 + 12 - j, 176, 12 - j, 14, j + 2); + } + } + + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { + String name = StatCollector.translateToLocal("tile.techreborn.extractor.name"); + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + +} diff --git a/src/main/java/techreborn/init/ModBlocks.java b/src/main/java/techreborn/init/ModBlocks.java index 2901057ea..5e0da4ca2 100644 --- a/src/main/java/techreborn/init/ModBlocks.java +++ b/src/main/java/techreborn/init/ModBlocks.java @@ -14,6 +14,9 @@ import techreborn.blocks.storage.BlockAesu; import techreborn.blocks.storage.BlockIDSU; import techreborn.blocks.storage.BlockLesu; import techreborn.blocks.storage.BlockLesuStorage; +import techreborn.blocks.teir1.BlockCompresser; +import techreborn.blocks.teir1.BlockElectricFurnace; +import techreborn.blocks.teir1.BlockExtractor; import techreborn.blocks.teir1.BlockGrinder; import techreborn.itemblocks.*; import techreborn.tiles.*; @@ -27,6 +30,9 @@ import techreborn.tiles.generator.TileSemifluidGenerator; import techreborn.tiles.idsu.TileIDSU; import techreborn.tiles.lesu.TileLesu; import techreborn.tiles.lesu.TileLesuStorage; +import techreborn.tiles.teir1.TileCompressor; +import techreborn.tiles.teir1.TileElectricFurnace; +import techreborn.tiles.teir1.TileExtractor; import techreborn.tiles.teir1.TileGrinder; public class ModBlocks { @@ -74,6 +80,9 @@ public class ModBlocks { public static Block playerDetector; public static Block Grinder; public static Block Generator; + public static Block Compressor; + public static Block Extractor; + public static Block ElectricFurnace; public static BlockOre ore; public static Block storage; @@ -256,6 +265,18 @@ public class ModBlocks { Generator = new BlockGenerator(); GameRegistry.registerBlock(Generator, "techreborn.generator"); GameRegistry.registerTileEntity(TileGenerator.class, "TileGeneratorTR"); + + Extractor = new BlockExtractor(Material.iron); + GameRegistry.registerBlock(Extractor, "techreborn.extractor"); + GameRegistry.registerTileEntity(TileExtractor.class, "TileExtractorTR"); + + Compressor = new BlockCompresser(Material.iron); + GameRegistry.registerBlock(Compressor, "techreborn.compressor"); + GameRegistry.registerTileEntity(TileCompressor.class, "TileCompressorTR"); + + ElectricFurnace = new BlockElectricFurnace(Material.iron); + GameRegistry.registerBlock(ElectricFurnace, "techreborn.electricfurnace"); + GameRegistry.registerTileEntity(TileElectricFurnace.class, "TileElectricFurnaceTR"); GameRegistry.registerTileEntity(TileMachineBase.class, "TileMachineBaseTR"); diff --git a/src/main/java/techreborn/init/ModRecipes.java b/src/main/java/techreborn/init/ModRecipes.java index 678bd733d..40111dca0 100644 --- a/src/main/java/techreborn/init/ModRecipes.java +++ b/src/main/java/techreborn/init/ModRecipes.java @@ -50,11 +50,13 @@ public class addImplosionCompressorRecipes(); addReactorRecipes(); addIc2Recipes(); + // DEBUG RecipeHandler.addRecipe(new GrinderRecipe(new ItemStack(Items.diamond), new ItemStack(Blocks.dirt), 5, 20)); + RecipeHandler.addRecipe(new ExtractorRecipe(new ItemStack(Items.diamond), new ItemStack(Blocks.dirt), 5, 20)); + RecipeHandler.addRecipe(new CompressorRecipe(new ItemStack(Items.diamond), new ItemStack(Blocks.dirt), 5, 20)); } static void addReactorRecipes(){ - FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium"), 40000000, 32768, 1024)); FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("tritium"), ItemCells.getCellByName("deuterium"), ItemCells.getCellByName("helium3"), 60000000, 32768, 2048)); FusionReactorRecipeHelper.registerRecipe(new FusionReactorRecipe(ItemCells.getCellByName("wolframium"), ItemCells.getCellByName("Berylium"), ItemDusts.getDustByName("platinum"), 80000000, -2048, 1024)); diff --git a/src/main/java/techreborn/lib/Reference.java b/src/main/java/techreborn/lib/Reference.java index f2ec32349..1dbd01254 100644 --- a/src/main/java/techreborn/lib/Reference.java +++ b/src/main/java/techreborn/lib/Reference.java @@ -16,4 +16,6 @@ public class Reference { public static String plateCuttingMachineRecipe = StatCollector.translateToLocal("techreborn.recipe.platecuttingmachine"); public static String vacuumFreezerRecipe = StatCollector.translateToLocal("tile.techreborn.vacuumfreezer.name"); public static String grinderRecipe = StatCollector.translateToLocal("tile.techreborn.grinder.name"); + public static String extractorRecipe = StatCollector.translateToLocal("tile.techreborn.extractor.name"); + public static String compressorRecipe = StatCollector.translateToLocal("tile.techreborn.compressor.name"); } diff --git a/src/main/java/techreborn/tiles/teir1/TileCompressor.java b/src/main/java/techreborn/tiles/teir1/TileCompressor.java new file mode 100644 index 000000000..bf00acb66 --- /dev/null +++ b/src/main/java/techreborn/tiles/teir1/TileCompressor.java @@ -0,0 +1,232 @@ +package techreborn.tiles.teir1; + +import ic2.api.tile.IWrenchable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import reborncore.common.util.Inventory; +import techreborn.api.recipe.RecipeCrafter; +import techreborn.init.ModBlocks; +import techreborn.lib.Reference; +import techreborn.powerSystem.TilePowerAcceptor; + +public class TileCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{ + + public Inventory inventory = new Inventory(6, "TileCompressor", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; + + public TileCompressor() { + super(1); + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; + crafter = new RecipeCrafter(Reference.compressorRecipe, this, 2, 1, inventory, inputs, outputs); + } + + @Override + public void updateEntity() { + super.updateEntity(); + crafter.updateEntity(); +// upgrades.tick(); + charge(3); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { + return false; + } + + @Override + public EnumFacing getFacing() { + return getFacingEnum(); + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + if (entityPlayer.isSneaking()) { + return true; + } + return false; + } + + @Override + public float getWrenchDropRate() { + return 1.0F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(ModBlocks.AlloySmelter, 1); + } + + public boolean isComplete() { + return false; + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } + +// @Override +// public void addWailaInfo(List info){ +// super.addWailaInfo(info); +// info.add("Power Stored " + energy.getEnergyStored() + "/" + energy.getCapacity() +" EU"); +// if(crafter.currentRecipe !=null){ +// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); +// } +// } + + @Override + public int getSizeInventory() { + return inventory.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int slot) { + return inventory.getStackInSlot(slot); + } + + @Override + public ItemStack decrStackSize(int slot, int amount) { + return inventory.decrStackSize(slot, amount); + } + + @Override + public ItemStack removeStackFromSlot(int slot) { + return inventory.removeStackFromSlot(slot); + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + inventory.setInventorySlotContents(slot, stack); + } + + + @Override + public int getInventoryStackLimit() { + return inventory.getInventoryStackLimit(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return inventory.isUseableByPlayer(player); + } + + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + return inventory.isItemValidForSlot(slot, stack); + } + + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; + } + + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } + + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + return slotIndex == 2; + } + + public int getProgressScaled(int scale) { + if (crafter.currentTickTime != 0) { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } + + @Override + public double getMaxPower() { + return capacity; + } + + @Override + public boolean canAcceptEnergy(EnumFacing direction) { + return true; + } + + @Override + public boolean canProvideEnergy(EnumFacing direction) { + return false; + } + + @Override + public double getMaxOutput() { + return 0; + } + + @Override + public double getMaxInput() { + return 32; + } + + @Override + public void openInventory(EntityPlayer player) { + inventory.openInventory(player); + } + + @Override + public void closeInventory(EntityPlayer player) { + inventory.closeInventory(player); + } + + + @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(); + } + + @Override + public String getName() { + return inventory.getName(); + } + + @Override + public boolean hasCustomName() { + return inventory.hasCustomName(); + } + + @Override + public IChatComponent getDisplayName() { + return inventory.getDisplayName(); + } +} diff --git a/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java b/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java new file mode 100644 index 000000000..38ef33971 --- /dev/null +++ b/src/main/java/techreborn/tiles/teir1/TileElectricFurnace.java @@ -0,0 +1,232 @@ +package techreborn.tiles.teir1; + +import ic2.api.tile.IWrenchable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import reborncore.common.util.Inventory; +import techreborn.api.recipe.RecipeCrafter; +import techreborn.init.ModBlocks; +import techreborn.lib.Reference; +import techreborn.powerSystem.TilePowerAcceptor; + +public class TileElectricFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{ + + public Inventory inventory = new Inventory(6, "TileElectricFurnace", 64, this); +// public RecipeCrafter crafter; + public int capacity = 1000; + + public TileElectricFurnace() { + super(1); + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; +// crafter = new RecipeCrafter(Reference.grinderRecipe, this, 2, 1, inventory, inputs, outputs); + } + + @Override + public void updateEntity() { + super.updateEntity(); +// crafter.updateEntity(); +// upgrades.tick(); + charge(3); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { + return false; + } + + @Override + public EnumFacing getFacing() { + return getFacingEnum(); + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + if (entityPlayer.isSneaking()) { + return true; + } + return false; + } + + @Override + public float getWrenchDropRate() { + return 1.0F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(ModBlocks.AlloySmelter, 1); + } + + public boolean isComplete() { + return false; + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); +// crafter.readFromNBT(tagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); +// crafter.writeToNBT(tagCompound); + } + +// @Override +// public void addWailaInfo(List info){ +// super.addWailaInfo(info); +// info.add("Power Stored " + energy.getEnergyStored() + "/" + energy.getCapacity() +" EU"); +// if(crafter.currentRecipe !=null){ +// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); +// } +// } + + @Override + public int getSizeInventory() { + return inventory.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int slot) { + return inventory.getStackInSlot(slot); + } + + @Override + public ItemStack decrStackSize(int slot, int amount) { + return inventory.decrStackSize(slot, amount); + } + + @Override + public ItemStack removeStackFromSlot(int slot) { + return inventory.removeStackFromSlot(slot); + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + inventory.setInventorySlotContents(slot, stack); + } + + + @Override + public int getInventoryStackLimit() { + return inventory.getInventoryStackLimit(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return inventory.isUseableByPlayer(player); + } + + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + return inventory.isItemValidForSlot(slot, stack); + } + + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; + } + + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } + + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + return slotIndex == 2; + } + +// public int getProgressScaled(int scale) { +// if (crafter.currentTickTime != 0) { +// return crafter.currentTickTime * scale / crafter.currentNeededTicks; +// } +// return 0; +// } + + @Override + public double getMaxPower() { + return capacity; + } + + @Override + public boolean canAcceptEnergy(EnumFacing direction) { + return true; + } + + @Override + public boolean canProvideEnergy(EnumFacing direction) { + return false; + } + + @Override + public double getMaxOutput() { + return 0; + } + + @Override + public double getMaxInput() { + return 32; + } + + @Override + public void openInventory(EntityPlayer player) { + inventory.openInventory(player); + } + + @Override + public void closeInventory(EntityPlayer player) { + inventory.closeInventory(player); + } + + + @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(); + } + + @Override + public String getName() { + return inventory.getName(); + } + + @Override + public boolean hasCustomName() { + return inventory.hasCustomName(); + } + + @Override + public IChatComponent getDisplayName() { + return inventory.getDisplayName(); + } +} diff --git a/src/main/java/techreborn/tiles/teir1/TileExtractor.java b/src/main/java/techreborn/tiles/teir1/TileExtractor.java new file mode 100644 index 000000000..efd80a5a9 --- /dev/null +++ b/src/main/java/techreborn/tiles/teir1/TileExtractor.java @@ -0,0 +1,232 @@ +package techreborn.tiles.teir1; + +import ic2.api.tile.IWrenchable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.IChatComponent; +import reborncore.common.util.Inventory; +import techreborn.api.recipe.RecipeCrafter; +import techreborn.init.ModBlocks; +import techreborn.lib.Reference; +import techreborn.powerSystem.TilePowerAcceptor; + +public class TileExtractor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory{ + + public Inventory inventory = new Inventory(6, "TileExtractor", 64, this); + public RecipeCrafter crafter; + public int capacity = 1000; + + public TileExtractor() { + super(1); + int[] inputs = new int[1]; + inputs[0] = 0; + int[] outputs = new int[1]; + outputs[0] = 1; + crafter = new RecipeCrafter(Reference.extractorRecipe, this, 2, 1, inventory, inputs, outputs); + } + + @Override + public void updateEntity() { + super.updateEntity(); + crafter.updateEntity(); +// upgrades.tick(); + charge(3); + } + + @Override + public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) { + return false; + } + + @Override + public EnumFacing getFacing() { + return getFacingEnum(); + } + + @Override + public boolean wrenchCanRemove(EntityPlayer entityPlayer) { + if (entityPlayer.isSneaking()) { + return true; + } + return false; + } + + @Override + public float getWrenchDropRate() { + return 1.0F; + } + + @Override + public ItemStack getWrenchDrop(EntityPlayer entityPlayer) { + return new ItemStack(ModBlocks.AlloySmelter, 1); + } + + public boolean isComplete() { + return false; + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + inventory.readFromNBT(tagCompound); + crafter.readFromNBT(tagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + inventory.writeToNBT(tagCompound); + crafter.writeToNBT(tagCompound); + } + +// @Override +// public void addWailaInfo(List info){ +// super.addWailaInfo(info); +// info.add("Power Stored " + energy.getEnergyStored() + "/" + energy.getCapacity() +" EU"); +// if(crafter.currentRecipe !=null){ +// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t"); +// } +// } + + @Override + public int getSizeInventory() { + return inventory.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int slot) { + return inventory.getStackInSlot(slot); + } + + @Override + public ItemStack decrStackSize(int slot, int amount) { + return inventory.decrStackSize(slot, amount); + } + + @Override + public ItemStack removeStackFromSlot(int slot) { + return inventory.removeStackFromSlot(slot); + } + + @Override + public void setInventorySlotContents(int slot, ItemStack stack) { + inventory.setInventorySlotContents(slot, stack); + } + + + @Override + public int getInventoryStackLimit() { + return inventory.getInventoryStackLimit(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer player) { + return inventory.isUseableByPlayer(player); + } + + + @Override + public boolean isItemValidForSlot(int slot, ItemStack stack) { + return inventory.isItemValidForSlot(slot, stack); + } + + // ISidedInventory + @Override + public int[] getSlotsForFace(EnumFacing side) { + return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2}; + } + + @Override + public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + if (slotIndex == 2) + return false; + return isItemValidForSlot(slotIndex, itemStack); + } + + @Override + public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) { + return slotIndex == 2; + } + + public int getProgressScaled(int scale) { + if (crafter.currentTickTime != 0) { + return crafter.currentTickTime * scale / crafter.currentNeededTicks; + } + return 0; + } + + @Override + public double getMaxPower() { + return capacity; + } + + @Override + public boolean canAcceptEnergy(EnumFacing direction) { + return true; + } + + @Override + public boolean canProvideEnergy(EnumFacing direction) { + return false; + } + + @Override + public double getMaxOutput() { + return 0; + } + + @Override + public double getMaxInput() { + return 32; + } + + @Override + public void openInventory(EntityPlayer player) { + inventory.openInventory(player); + } + + @Override + public void closeInventory(EntityPlayer player) { + inventory.closeInventory(player); + } + + + @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(); + } + + @Override + public String getName() { + return inventory.getName(); + } + + @Override + public boolean hasCustomName() { + return inventory.hasCustomName(); + } + + @Override + public IChatComponent getDisplayName() { + return inventory.getDisplayName(); + } +} diff --git a/src/main/resources/assets/techreborn/lang/en_US.lang b/src/main/resources/assets/techreborn/lang/en_US.lang index b10da9485..45f47e5c2 100644 --- a/src/main/resources/assets/techreborn/lang/en_US.lang +++ b/src/main/resources/assets/techreborn/lang/en_US.lang @@ -53,6 +53,9 @@ tile.techreborn.chargebench.name=Charge Bench tile.techreborn.playerDetector.all.name=Player Detector (All) tile.techreborn.playerDetector.others.name=Player Detector (Others) tile.techreborn.playerDetector.you.name=Player Detector (You) +tile.techreborn.extractor.name=Extractor +tile.techreborn.compressor.name=Compressor +tile.techreborn.electricfurnace.name=Electric Furnace #Ores tile.techreborn.ore.Galena.name=Galena Ore diff --git a/src/main/resources/assets/techreborn/textures/gui/compressor.png b/src/main/resources/assets/techreborn/textures/gui/compressor.png new file mode 100644 index 0000000000000000000000000000000000000000..1c4222ba4ac886d4bd960438358e09c6fd010d84 GIT binary patch literal 2274 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5D>38$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&di49pAxJ|V6^adUI?(9qC~jEuV4+H>+^7v#jQ%86W+6TK-bd|OuJf|BG7 zCCS^$Qn%D(&+DljGS)e2XMW7y;)J!yYe~MBlKk%^c;86!J(d!9AT9VwoadVu_h$*- zU!t7WQ7{?;gC_)dc=c>Rxuzt@FBq6UM>1dt z{?4unj2X@XkH}&M2EM}}%y>M1MG8<*qQo_#Bsf2#LBcKZlG@c@|ASYr?FuaVzrAC_9tVX4g`1|4`-;=% z_)qt_Q`@G-mptjYr_IyKd8Jxn=X6d^jEj|T7-%&#lBtaU)`@56r?Vh>Vh?W-sb|K|tPmdzUR_4c&Y zq6eN?*4F&mS<;ZJzx_1VgU8OZYU}Py;kG&|d6Z+q-&6ngl$tk$Ht78Ra@Xv@@BEkH zhvzf8mYP}7nw<1Wz!>u&BjXT19b6O$?=WR4xV_Tu|09NNS5JP^3U{|->He($ zp6|u>?=BhpfBk8zW7&1}xj9e3-1~YB=kmoC*wvdb{PM6qQ+r~oFKfo7%CztI8B69h zSM8Qyy|8aD>w!*&U4^%+wtt8?&3IwoEVX^zrVUfmCR;Y_bEsiheKl(TYZK9g+rk|J z2|qF>GgdKOWbBz!&*l(*K*_;f!K`89=YHlF^I1#Z-I@nf|N5c-!9s?=JA;4o1v9$M z=g7Q&@0Yp5#=CcS?Ki)!aUkmV+Nkn%qQ0ybc&~)n3trl{x0EO0d7Z2o*M+ltbN*jS zVbC?-`TGBV_XRu3!<(`gE_u(A27Z1vpTb)D7; zKa2~E9O^CY8ot>tERkaUu{N^w1Fw|gfr7*LFCUNQIk1v(!DktkhPVX`7m6+iG4R>j zy#B(pHKGA1UTn@7u#PE#{ejm!j#xcg_N?7!gcqJZn%;2kE{nrXQ013#{~i;NVkoG8 zJe3ticvl$1XaANqP<^;1KmRI2)wf&QuIB9i;FZBpd)wsgx?Er_2mzoVhOrq6eu#X# z6~@H;VyAcXfpqIxxs$`3m|ys1b5$76-v+h{q!eZ?SR2Q8mE+gF5*TdDGr51{xNpwA z1hnIBrY~duv&&&{gWukchO-$S&U^ABijzmc9VpcB?d@7Ahx2i_ne6Ug&6&MLNXp^9 znJ?r13x3g{IvosvK7g|sTB>Kg&Q>*WkYQwK$ZeP{z)%^qFW-cf;e_zsa-K^2dd`49 z5-!18Gv~8boZi9Ya5;w|V-_!i?`FmYnPvjd|cDA2U?`6L0C~ Vyl?w?-A9mLJzf1=);T3K0RTG>CPM%K literal 0 HcmV?d00001