diff --git a/src/main/java/tconstruct/tools/items/Manual.java b/src/main/java/tconstruct/tools/items/Manual.java index df591539..ac16320a 100644 --- a/src/main/java/tconstruct/tools/items/Manual.java +++ b/src/main/java/tconstruct/tools/items/Manual.java @@ -8,6 +8,7 @@ import mantle.books.BookData; import mantle.client.gui.GuiManual; import mantle.items.abstracts.CraftingItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -29,17 +30,23 @@ public class Manual extends CraftingItem } @Override - @SideOnly(Side.CLIENT) public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) { TAchievements.triggerAchievement(player, "tconstruct.beginner"); - Side side = FMLCommonHandler.instance().getEffectiveSide(); - player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0); - FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(stack, getData(stack))); + if(world.isRemote) { + openBook(stack, world, player); + } return stack; } + @SideOnly(Side.CLIENT) + public void openBook(ItemStack stack, World world, EntityPlayer player) { + player.openGui(TConstruct.instance, mantle.client.MProxyClient.manualGuiID, world, 0, 0, 0); + FMLClientHandler.instance().displayGuiScreen(player, new GuiManual(stack, getData(stack))); + } + + private BookData getData (ItemStack stack) { switch (stack.getItemDamage())