Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package palmerjj01.YoshiCraft.Gui;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.world.World;
- import palmerjj01.YoshiCraft.YoshiCraft;
- import palmerjj01.YoshiCraft.Container.ContainerYoshiOven;
- import palmerjj01.YoshiCraft.TileEntity.TileEntityYoshiOven;
- import cpw.mods.fml.common.network.IGuiHandler;
- public class GuiHandler implements IGuiHandler{
- private Object entity;
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world,
- int x, int y, int z) {
- if(entity != null) {
- switch(ID) {
- case YoshiCraft.guiIDYoshiOven:
- if(entity instanceof TileEntityYoshiOven) {
- return new ContainerYoshiOven(player.inventory, (TileEntityYoshiOven) entity);
- }
- }
- }
- return null;
- }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world,
- int x, int y, int z) {
- TileEntity entity = world.getTileEntity(x, y, z);
- if(entity != null) {
- switch(ID) {
- case YoshiCraft.guiIDYoshiOven:
- if(entity instanceof TileEntityYoshiOven) {
- return new GuiYoshiOven(player.inventory, (TileEntityYoshiOven) entity);
- }
- }
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment