From ed10d3c799f22d56a92a9af91da7dd23e09f248e Mon Sep 17 00:00:00 2001 From: Meredith Espinosa Date: Wed, 4 Jul 2018 10:09:06 -0700 Subject: [PATCH] fix issue where bracelets just wouldn't work because NBT UUIDs are weird --- .../elytradev/friendshipbracelet/FriendshipBracelet.java | 1 - .../friendshipbracelet/ItemFriendshipBracelet.java | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/elytradev/friendshipbracelet/FriendshipBracelet.java b/src/main/java/com/elytradev/friendshipbracelet/FriendshipBracelet.java index 6839cbf..d8971d3 100644 --- a/src/main/java/com/elytradev/friendshipbracelet/FriendshipBracelet.java +++ b/src/main/java/com/elytradev/friendshipbracelet/FriendshipBracelet.java @@ -22,7 +22,6 @@ public class FriendshipBracelet { public static final String name = "Friendship Bracelet"; public static final String version = "@VERSION@"; - @Mod.Instance(modId) public static FriendshipBracelet instance; diff --git a/src/main/java/com/elytradev/friendshipbracelet/ItemFriendshipBracelet.java b/src/main/java/com/elytradev/friendshipbracelet/ItemFriendshipBracelet.java index f3b85df..276d72e 100644 --- a/src/main/java/com/elytradev/friendshipbracelet/ItemFriendshipBracelet.java +++ b/src/main/java/com/elytradev/friendshipbracelet/ItemFriendshipBracelet.java @@ -62,7 +62,9 @@ public ActionResult onItemRightClick(World world, EntityPlayer player MinecraftServer server = world.getMinecraftServer(); if (!world.isRemote) { - if (!item.hasTagCompound() || !item.getTagCompound().hasKey("PlayerID")) { + FBLog.info(item.getTagCompound().hasKey("PlayerIDMost")); + FBLog.info(item.getTagCompound()); + if (!item.hasTagCompound() || !item.getTagCompound().hasKey("PlayerIDMost")) { if (!item.hasTagCompound()) item.setTagCompound(new NBTTagCompound()); item.getTagCompound().setUniqueId("PlayerID", player.getPersistentID()); TextComponentTranslation bracelet = new TextComponentTranslation("item.friendship_bracelet.rename"); @@ -121,7 +123,7 @@ private boolean isAcceptingTeleports(EntityPlayer player) { ItemStack stackInSlot = baubles.getStackInSlot(i); if (!stackInSlot.isEmpty()) { FBLog.info(i); - return baubles.getStackInSlot(i).getItem().equals(this.FRIENDSHIP_BRACELET); + return baubles.getStackInSlot(i).getItem().equals(FRIENDSHIP_BRACELET); } } return false;