New Repo
This commit is contained in:
38
src/main/java/com/kitsu/medievalcraft/gui/GuiForgeAnvil.java
Normal file
38
src/main/java/com/kitsu/medievalcraft/gui/GuiForgeAnvil.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.kitsu.medievalcraft.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.contain.ContainerForgeAnvil;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityAnvilForge;
|
||||
|
||||
public class GuiForgeAnvil extends GuiContainer {
|
||||
private ResourceLocation texture = new ResourceLocation(Main.MODID + ":" + "textures/gui/forgeovengui.png");
|
||||
|
||||
public GuiForgeAnvil(InventoryPlayer inventoryPlayer, TileEntityAnvilForge tileEntity) {
|
||||
super(new ContainerForgeAnvil(inventoryPlayer, tileEntity));
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
//String name = "Forge";
|
||||
|
||||
//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);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
}
|
||||
48
src/main/java/com/kitsu/medievalcraft/gui/GuiFormTable.java
Normal file
48
src/main/java/com/kitsu/medievalcraft/gui/GuiFormTable.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.kitsu.medievalcraft.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.contain.ContainerFormTable;
|
||||
|
||||
public class GuiFormTable extends GuiContainer {
|
||||
|
||||
private ResourceLocation texture = new ResourceLocation(Main.MODID + ":" + "textures/gui/formtablegui.png");
|
||||
|
||||
public GuiFormTable(InventoryPlayer playerinv, World world, int x, int y, int z) {
|
||||
|
||||
super(new ContainerFormTable(playerinv, world, x, y, z));
|
||||
this.xSize = 200;
|
||||
this.ySize = 200;
|
||||
|
||||
}
|
||||
|
||||
public void onGuiClosed(){
|
||||
super.onGuiClosed();
|
||||
}
|
||||
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
//Name xstart ystart color
|
||||
this.fontRendererObj.drawString(StatCollector.translateToLocal("Form Table"), 100, 5, 0xFFFFFF);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
68
src/main/java/com/kitsu/medievalcraft/gui/GuiHandler.java
Normal file
68
src/main/java/com/kitsu/medievalcraft/gui/GuiHandler.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package com.kitsu.medievalcraft.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.kitsu.medievalcraft.block.ModBlocks;
|
||||
import com.kitsu.medievalcraft.contain.ContainerForgeAnvil;
|
||||
import com.kitsu.medievalcraft.contain.ContainerFormTable;
|
||||
import com.kitsu.medievalcraft.contain.ContainerSolidFilter;
|
||||
import com.kitsu.medievalcraft.contain.ContainerTestForge;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityAnvilForge;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntitySolidFilter;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityTestForge;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
||||
public static final int guiIDformTable = 1;
|
||||
public static final int guiIDforge = 2;
|
||||
public static final int guiIDforgeAnvil = 3;
|
||||
public static final int guiIDsolidFilter = 4;
|
||||
|
||||
//returns an instance of the Container you made earlier
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
if (id == guiIDformTable) {
|
||||
return id == guiIDformTable && world.getBlock(x, y, z) == ModBlocks.formtable ? new ContainerFormTable(player.inventory, world, x, y, z) : null;
|
||||
}
|
||||
if (entity instanceof TileEntityTestForge) {
|
||||
return new ContainerTestForge(player.inventory, (TileEntityTestForge) entity);
|
||||
}
|
||||
if (entity instanceof TileEntityAnvilForge) {
|
||||
return new ContainerForgeAnvil(player.inventory, (TileEntityAnvilForge) entity);
|
||||
}
|
||||
if (entity instanceof TileEntitySolidFilter) {
|
||||
return new ContainerSolidFilter(player.inventory, (TileEntitySolidFilter) entity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//returns an instance of the Gui you made earlier
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
if (id == guiIDformTable) {
|
||||
return id == guiIDformTable && world.getBlock(x, y, z) == ModBlocks.formtable ? new GuiFormTable(player.inventory, world, x, y, z) : null;
|
||||
}
|
||||
if (entity instanceof TileEntityTestForge) {
|
||||
return new GuiTestForge(player.inventory, (TileEntityTestForge) entity);
|
||||
}
|
||||
if (entity instanceof TileEntityAnvilForge) {
|
||||
return new GuiForgeAnvil(player.inventory, (TileEntityAnvilForge) entity);
|
||||
}
|
||||
if (entity instanceof TileEntitySolidFilter) {
|
||||
return new GuiSolidFilter(player.inventory, (TileEntitySolidFilter) entity);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.kitsu.medievalcraft.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.contain.ContainerSolidFilter;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntitySolidFilter;
|
||||
|
||||
public class GuiSolidFilter extends GuiContainer {
|
||||
|
||||
private ResourceLocation texture = new ResourceLocation(Main.MODID + ":" + "textures/gui/solidfiltergui.png");
|
||||
|
||||
public GuiSolidFilter(InventoryPlayer inventoryPlayer, TileEntitySolidFilter tileEntity) {
|
||||
super(new ContainerSolidFilter(inventoryPlayer, tileEntity));
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
//String name = "Forge";
|
||||
|
||||
//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);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
38
src/main/java/com/kitsu/medievalcraft/gui/GuiTestForge.java
Normal file
38
src/main/java/com/kitsu/medievalcraft/gui/GuiTestForge.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.kitsu.medievalcraft.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.kitsu.medievalcraft.Main;
|
||||
import com.kitsu.medievalcraft.contain.ContainerTestForge;
|
||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityTestForge;
|
||||
|
||||
public class GuiTestForge extends GuiContainer {
|
||||
private ResourceLocation texture = new ResourceLocation(Main.MODID + ":" + "textures/gui/forgeovengui.png");
|
||||
|
||||
public GuiTestForge(InventoryPlayer inventoryPlayer, TileEntityTestForge tileEntity) {
|
||||
super(new ContainerTestForge(inventoryPlayer, tileEntity));
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
//String name = "Forge";
|
||||
|
||||
//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);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user