Skip to content

Commit

Permalink
fix issue where bracelets just wouldn't work because NBT UUIDs are weird
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Jul 4, 2018
1 parent 770102b commit ed10d3c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public ActionResult<ItemStack> 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");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ed10d3c

Please sign in to comment.