-
Notifications
You must be signed in to change notification settings - Fork 4
/
TombStoneGUIHandler.java
28 lines (25 loc) · 1 KB
/
TombStoneGUIHandler.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package TombStone;
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 TombStoneGUIHandler 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 = world.getBlockTileEntity(x, y, z);
if(tileEntity instanceof TombStoneTileEntity){
return new TombStoneContainer(player.inventory, (TombStoneTileEntity) 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 = world.getBlockTileEntity(x, y, z);
if(tileEntity instanceof TombStoneTileEntity){
return new TombStoneGUI(player.inventory, (TombStoneTileEntity) tileEntity);
}
return null;
}
}