Added compressor, extractor, electric furnace
This commit is contained in:
parent
cd13932bde
commit
047625389d
21 changed files with 1345 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
52
src/main/java/techreborn/client/gui/GuiCompressor.java
Normal file
52
src/main/java/techreborn/client/gui/GuiCompressor.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
58
src/main/java/techreborn/client/gui/GuiElectricFurnace.java
Normal file
58
src/main/java/techreborn/client/gui/GuiElectricFurnace.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
56
src/main/java/techreborn/client/gui/GuiExtractor.java
Normal file
56
src/main/java/techreborn/client/gui/GuiExtractor.java
Normal file
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue