Finish on Iron furnace
Added Jei support to Iron Furnace
This commit is contained in:
parent
961e821402
commit
90f5d77a41
9 changed files with 493 additions and 6 deletions
|
@ -28,6 +28,7 @@ import techreborn.client.container.ContainerImplosionCompressor;
|
|||
import techreborn.client.container.ContainerIndustrialElectrolyzer;
|
||||
import techreborn.client.container.ContainerIndustrialGrinder;
|
||||
import techreborn.client.container.ContainerIndustrialSawmill;
|
||||
import techreborn.client.container.ContainerIronFurnace;
|
||||
import techreborn.client.container.ContainerLesu;
|
||||
import techreborn.client.container.ContainerMatterFabricator;
|
||||
import techreborn.client.container.ContainerQuantumChest;
|
||||
|
@ -60,6 +61,7 @@ import techreborn.client.gui.GuiImplosionCompressor;
|
|||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.client.gui.GuiIndustrialGrinder;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.client.gui.GuiIronFurnace;
|
||||
import techreborn.client.gui.GuiLesu;
|
||||
import techreborn.client.gui.GuiMatterFabricator;
|
||||
import techreborn.client.gui.GuiQuantumChest;
|
||||
|
@ -83,6 +85,7 @@ import techreborn.tiles.TileImplosionCompressor;
|
|||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||
import techreborn.tiles.TileIndustrialGrinder;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
import techreborn.tiles.TileMatterFabricator;
|
||||
import techreborn.tiles.TileQuantumChest;
|
||||
import techreborn.tiles.TileQuantumTank;
|
||||
|
@ -136,6 +139,7 @@ public class GuiHandler implements IGuiHandler {
|
|||
public static final int extractorID = 33;
|
||||
public static final int compressorID = 34;
|
||||
public static final int electricFurnaceID = 35;
|
||||
public static final int ironFurnace = 36;
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
|
@ -226,9 +230,9 @@ public class GuiHandler implements IGuiHandler {
|
|||
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);
|
||||
}else if (ID == ironFurnace) {
|
||||
return new ContainerIronFurnace((TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -322,7 +326,10 @@ public class GuiHandler implements IGuiHandler {
|
|||
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)));
|
||||
}else if (ID == ironFurnace) {
|
||||
return new GuiIronFurnace(player, (TileIronFurnace) world.getTileEntity(new BlockPos(x, y, z)));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotFurnaceFuel;
|
||||
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.TileIronFurnace;
|
||||
|
||||
public class ContainerIronFurnace extends RebornContainer {
|
||||
|
||||
EntityPlayer player;
|
||||
|
||||
TileIronFurnace tile;
|
||||
|
||||
public int connectionStatus;
|
||||
|
||||
public ContainerIronFurnace(TileIronFurnace tileGrinder, EntityPlayer player) {
|
||||
super();
|
||||
tile = tileGrinder;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new Slot(tileGrinder.inventory, 0, 56, 17));
|
||||
this.addSlotToContainer(new SlotOutput(tileGrinder.inventory, 1, 116, 34));
|
||||
//Fuel
|
||||
this.addSlotToContainer(new SlotFurnaceFuel(tileGrinder.inventory, 2, 56, 53));
|
||||
|
||||
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 player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void updateProgressBar(int id, int value) {
|
||||
if (id == 10) {
|
||||
this.connectionStatus = value;
|
||||
}
|
||||
}
|
||||
}
|
56
src/main/java/techreborn/client/gui/GuiIronFurnace.java
Normal file
56
src/main/java/techreborn/client/gui/GuiIronFurnace.java
Normal file
|
@ -0,0 +1,56 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
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.ContainerIronFurnace;
|
||||
import techreborn.tiles.TileIronFurnace;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
|
||||
public class GuiIronFurnace extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation texture = new ResourceLocation("minecraft", "textures/gui/container/furnace.png");
|
||||
|
||||
TileIronFurnace furnace;
|
||||
ContainerIronFurnace containerGrinder;
|
||||
|
||||
public GuiIronFurnace(EntityPlayer player, TileIronFurnace tilegrinder) {
|
||||
super(new ContainerIronFurnace(tilegrinder, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
furnace = tilegrinder;
|
||||
containerGrinder = (ContainerIronFurnace) this.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
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.gaugeProgressScaled(24);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 78, l + 35, 176, 14, j + 1, 16);
|
||||
}
|
||||
|
||||
j = furnace.gaugeFuelScaled(12);
|
||||
if (j > 0) {
|
||||
this.drawTexturedModalRect(k + 57, 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.ironfurnace.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