Skip to content

Commit

Permalink
Fix the first achievement that's needed for all other achievements no…
Browse files Browse the repository at this point in the history
…t being called serverside #1317
  • Loading branch information
bonii-xx committed Feb 22, 2015
1 parent f634389 commit dd56e0d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/main/java/tconstruct/tools/items/Manual.java
Expand Up @@ -8,6 +8,7 @@
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;
Expand All @@ -29,17 +30,23 @@ public Manual()
}

@Override
@SideOnly(Side.CLIENT)
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
TAchievements.triggerAchievement(player, "tconstruct.beginner");

Side side = FMLCommonHandler.instance().getEffectiveSide();
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)));
return stack;
}


private BookData getData (ItemStack stack)
{
switch (stack.getItemDamage())
Expand Down

0 comments on commit dd56e0d

Please sign in to comment.