13 nov. 2020, 19:05
package fr.havzen.irizium.tileentity;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IGuiHandler;

public class GuiHandlerIri implements IGuiHandler {

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world,int x, int y, int z) 
	{
		TileEntity tile = world.getTileEntity(x, y, z);
		if(tile instanceof TileEntityIrizium)
		{
			return new ContainerIrizium((TileEntityIrizium)tile, player.inventory);
		}
		return null;
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world,int x, int y, int z) 
	{
		TileEntity tile = world.getTileEntity(x, y, z);
		if(tile instanceof TileEntityIrizium)
		{
			return new GuiIrizium((TileEntityIrizium)tile, player.inventory);
		}
		return null;
	}
}