From 28a851138a1eb354c693040bc86fd6bdd8e874c2 Mon Sep 17 00:00:00 2001 From: TheOldOne822 Date: Sun, 12 Jun 2016 22:29:16 -0700 Subject: [PATCH] Opening TravellersGear GUI give Taking Inventory Small change that makes opening the TravellersGear GUI give the Taking Inventory Achievement. --- .../java/travellersgear/common/network/MessageOpenGui.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/travellersgear/common/network/MessageOpenGui.java b/src/main/java/travellersgear/common/network/MessageOpenGui.java index d773888..8bedc9d 100644 --- a/src/main/java/travellersgear/common/network/MessageOpenGui.java +++ b/src/main/java/travellersgear/common/network/MessageOpenGui.java @@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.stats.AchievementList; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; @@ -67,7 +68,8 @@ public IMessage onMessage(MessageOpenGui message, MessageContext ctx) // PacketPipeline.INSTANCE.sendTo(new PacketOpenGui(player,message.guiid), (EntityPlayerMP) player); boolean hasServerGui = TravellersGear.proxy.getServerGuiElement(message.guiid, player, world, (int)player.posX, (int)player.posY, (int)player.posZ)!=null; player.openGui(TravellersGear.instance, message.guiid, player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY), MathHelper.floor_double(player.posZ)); + player.addStat(AchievementList.openInventory, 1); return hasServerGui?null: new MessageOpenGui(player,message.guiid); } } -} \ No newline at end of file +}