Skip to content

Commit

Permalink
better variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Aug 14, 2023
1 parent 27993ba commit 4da6d72
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -373,11 +373,11 @@ public void mergeNbt(org.bukkit.entity.Entity entity, CompoundTag nbt) {
net.minecraft.nbt.CompoundTag nativeNbt = nmsUtils.getNbtUtils().toNativeCompound(nbt);
Entity nmsEntity = ((CraftEntity) entity).getHandle();

net.minecraft.nbt.CompoundTag compoundTag = nmsEntity.saveWithoutId(new net.minecraft.nbt.CompoundTag());
net.minecraft.nbt.CompoundTag compoundTag2 = compoundTag.copy().merge(nativeNbt);
if (!compoundTag.equals(compoundTag2)) {
net.minecraft.nbt.CompoundTag oldNbt = nmsEntity.saveWithoutId(new net.minecraft.nbt.CompoundTag());
net.minecraft.nbt.CompoundTag newNbt = oldNbt.copy().merge(nativeNbt);
if (!oldNbt.equals(newNbt)) {
UUID uuid = nmsEntity.getUUID();
nmsEntity.load(compoundTag2);
nmsEntity.load(newNbt);
nmsEntity.setUUID(uuid);
}
}
Expand Down

0 comments on commit 4da6d72

Please sign in to comment.