So I tried to make a gui with the Containers and GUIs tutorial on the wiki, but it says it's out of date...
Here's the current code for my book:
package com.budboy.am.item;
import com.budboy.am.creativetab.CreativeTab;
import com.budboy.am.gui.GuiIDs;
import com.budboy.am.main.AncientMagicMain;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemWritableBook;
import net.minecraft.world.World;
public class ItemMagicBook extends ItemWritableBook {
@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int sideHit, float hitVecX, float hitVecY, float hitVecZ) {
if (world.isRemote) {
entityPlayer.openGui(AncientMagicMain.instance, GuiIDs.MagicBookGui, world, x, y, z);
}
return true;
}
public ItemMagicBook() {
maxStackSize = 64;
setCreativeTab(CreativeTab.magicTab);
setUnlocalizedName("magicBook");
setTextureName("am:magicBook");
}
}