1.7.2 commit

This commit is contained in:
WayofTime 2014-02-14 15:20:20 -05:00
parent 92e097eaa2
commit 9aaa65feb4
548 changed files with 46982 additions and 2 deletions

View file

@ -0,0 +1,73 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler
{
//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 tileEntity;
switch (id)
{
case 0:
tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TEWritingTable)
{
return new ContainerWritingTable(player.inventory, (TEWritingTable) tileEntity);
}
case 1:
tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TETeleposer)
{
return new ContainerTeleposer(player.inventory, (TETeleposer) tileEntity);
}
}
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 tileEntity;
switch (id)
{
case 0:
tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TEWritingTable)
{
return new GuiWritingTable(player.inventory, (TEWritingTable) tileEntity);
}
break;
case 1:
tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof TETeleposer)
{
return new GuiTeleposer(player.inventory, (TETeleposer) tileEntity);
}
break;
}
return null;
}
}

View file

@ -0,0 +1,47 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import net.minecraft.client.gui.inventory.GuiBrewingStand;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerTeleposer;
public class GuiTeleposer extends GuiContainer
{
public GuiTeleposer(InventoryPlayer inventoryPlayer, TETeleposer tileEntity)
{
//the container is instanciated and passed to the superclass for handling
super(new ContainerTeleposer(inventoryPlayer, tileEntity));
xSize = 176;
ySize = 222;
}
@Override
protected void drawGuiContainerForegroundLayer(int param1, int param2)
{
//draw text and stuff here
//the parameters for drawString are: string, x, y, color
fontRendererObj.drawString("Teleposer", 8, 6, 4210752);
//draws "Inventory" or your regional equivalent
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 130, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
//draw your Gui here, only thing you need to change is the path
//ResourceLocation texture = mc.renderEngine.getTexture("/gui/trap.png");
ResourceLocation test = new ResourceLocation("alchemicalwizardry", "gui/Teleposer.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(test);
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
GuiBrewingStand d;
}
}

View file

@ -0,0 +1,45 @@
package WayofTime.alchemicalWizardry.common.tileEntity.gui;
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
import WayofTime.alchemicalWizardry.common.tileEntity.container.ContainerWritingTable;
import net.minecraft.client.gui.inventory.GuiBrewingStand;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
public class GuiWritingTable extends GuiContainer
{
public GuiWritingTable(InventoryPlayer inventoryPlayer, TEWritingTable tileEntity)
{
//the container is instanciated and passed to the superclass for handling
super(new ContainerWritingTable(inventoryPlayer, tileEntity));
xSize = 176;
ySize = 222;
}
@Override
protected void drawGuiContainerForegroundLayer(int param1, int param2)
{
//draw text and stuff here
//the parameters for drawString are: string, x, y, color
fontRendererObj.drawString("Alchemic Chemistry Set", 8, 6, 4210752);
//draws "Inventory" or your regional equivalent
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, 130, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
{
//draw your Gui here, only thing you need to change is the path
//ResourceLocation texture = mc.renderEngine.getTexture("/gui/trap.png");
ResourceLocation test = new ResourceLocation("alchemicalwizardry", "gui/WritingTable.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(test);
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
GuiBrewingStand d;
}
}