Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package io.github.hsyyid.wilsonsmp;
- import io.github.hsyyid.wilsonsmp.gui.GuiReadableBookshelf;
- import io.github.hsyyid.wilsonsmp.tileentities.TileEntityReadableBookshelf;
- 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 GuiHandler implements IGuiHandler
- {
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- if (ID == 1)
- {
- TileEntityReadableBookshelf bookshelf = (TileEntityReadableBookshelf) (world.getTileEntity(new BlockPos(x, y, z)));
- return bookshelf.getNewContainer(player);
- }
- return null;
- }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- System.out.println("Haiaiaiai");
- if (ID == 1)
- {
- System.out.println("Opened GUI");
- return new GuiReadableBookshelf(player, (TileEntityReadableBookshelf) (world.getTileEntity(new BlockPos(x, y, z))));
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement