Skip to content

Commit

Permalink
Fix server startup crash
Browse files Browse the repository at this point in the history
  • Loading branch information
copygirl committed Nov 29, 2014
1 parent 4dee220 commit 8b5ecda
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreenBook;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemEditableBook;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -114,11 +115,15 @@ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer pla

);

showBookScreen(player, pages);
return stack;
}

@SideOnly(Side.CLIENT)
public static void showBookScreen(EntityPlayer player, NBTTagList pages) {
ItemStack stack = new ItemStack(Items.written_book);
StackUtils.set(stack, pages, "pages");
Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(player, stack, false));
StackUtils.remove(stack, "pages");

return stack;
}

}

0 comments on commit 8b5ecda

Please sign in to comment.