Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package iitest.gui;
- import iitest.capability.ITest;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.common.network.IGuiHandler;
- import javax.annotation.Nullable;
- public class TestHandler implements IGuiHandler {
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- // I am aware this code makes a few potentially incorrect assumptions.
- return new TestContainer(player.getHeldItemMainhand().getCapability(ITest.instance, null), player);
- }
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- return new TestGui(player.getHeldItemMainhand().getCapability(ITest.instance, null), player);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement