Skip to content

Instantly share code, notes, and snippets.

/ModGuiHandler Secret

Created March 31, 2017 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/005c9334f81744d478a6dabf3e73bc9c to your computer and use it in GitHub Desktop.
Save anonymous/005c9334f81744d478a6dabf3e73bc9c to your computer and use it in GitHub Desktop.
package com.chocolatemod.main;
import com.chocolatemod.specialblocks.container.ContainerTileEntityPress;
import com.chocolatemod.specialblocks.container.GuiTileEntityPress;
import com.chocolatemod.specialblocks.tileentity.TileEntityPress;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
public class ModGuiHandler implements IGuiHandler{
public static final int hydraulicPress_tileEntity_gui = 0;
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID == hydraulicPress_tileEntity_gui)
return new ContainerTileEntityPress(player.inventory, (TileEntityPress) world.getTileEntity(new BlockPos(x, y, z)));
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID == hydraulicPress_tileEntity_gui)
return new GuiTileEntityPress(player.inventory, (TileEntityPress) world.getTileEntity(new BlockPos(x, y, z)));
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment