Basic gui and container

This commit is contained in:
Gig 2015-04-28 21:09:38 +01:00
parent 0c514596a1
commit 92cccee9e9
2 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,19 @@
package techreborn.client.container;
import techreborn.tiles.TileChunkLoader;
import net.minecraft.entity.player.EntityPlayer;
public class ContainerChunkloader extends TechRebornContainer{
public ContainerChunkloader(TileChunkLoader tilechunkloader, EntityPlayer player)
{
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_)
{
return true;
}
}

View file

@ -0,0 +1,47 @@
package techreborn.client.gui;
import techreborn.client.container.ContainerAlloySmelter;
import techreborn.client.container.ContainerChunkloader;
import techreborn.tiles.TileAlloySmelter;
import techreborn.tiles.TileChunkLoader;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation;
public class GuiChunkLoader extends GuiContainer{
private static final ResourceLocation texture = new ResourceLocation(
"techreborn", "textures/gui/industrial_chunkloader.png");
TileChunkLoader chunkloader;
public GuiChunkLoader(EntityPlayer player, TileChunkLoader tilechunkloader)
{
super(new ContainerChunkloader(tilechunkloader, player));
this.xSize = 176;
this.ySize = 167;
chunkloader = tilechunkloader;
}
@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);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_)
{
this.fontRendererObj.drawString("Industrial Chunkloader", 60, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}
}