3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

SPIGOT-3248: Don't set shoulder compounds of EntityHuman to null

Dieser Commit ist enthalten in:
BlackHole 2017-05-17 20:26:51 +02:00 committet von md_5
Ursprung 45102fcf28
Commit 3ecbb59cbb

Datei anzeigen

@ -443,7 +443,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public org.bukkit.entity.Entity getShoulderEntityLeft() {
if (getHandle().getShoulderEntityLeft() != null) {
if (!getHandle().getShoulderEntityLeft().isEmpty()) {
Entity shoulder = EntityTypes.a(getHandle().getShoulderEntityLeft(), getHandle().world);
return (shoulder == null) ? null : shoulder.getBukkitEntity();
@ -454,7 +454,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public void setShoulderEntityLeft(org.bukkit.entity.Entity entity) {
getHandle().setShoulderEntityLeft(entity == null ? null : ((CraftEntity) entity).save());
getHandle().setShoulderEntityLeft(entity == null ? new NBTTagCompound() : ((CraftEntity) entity).save());
if (entity != null) {
entity.remove();
}
@ -462,7 +462,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public org.bukkit.entity.Entity getShoulderEntityRight() {
if (getHandle().getShoulderEntityRight() != null) {
if (!getHandle().getShoulderEntityRight().isEmpty()) {
Entity shoulder = EntityTypes.a(getHandle().getShoulderEntityRight(), getHandle().world);
return (shoulder == null) ? null : shoulder.getBukkitEntity();
@ -473,7 +473,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override
public void setShoulderEntityRight(org.bukkit.entity.Entity entity) {
getHandle().setShoulderEntityRight(entity == null ? null : ((CraftEntity) entity).save());
getHandle().setShoulderEntityRight(entity == null ? new NBTTagCompound() : ((CraftEntity) entity).save());
if (entity != null) {
entity.remove();
}