Fix mobs not burning from summon command (#5961)

This commit is contained in:
Jake Potrebic 2021-06-23 01:07:59 -07:00 committed by GitHub
parent a7cddc4153
commit b1f6e2698e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 8 deletions

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add a "should burn in sunlight" API for Phantoms and
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
index 6b4163f5601a0961055c8451ec7ef2204938cf69..c54a37516ef1d8a76f7161917bf448127cd98603 100644 index 6b4163f5601a0961055c8451ec7ef2204938cf69..cd75f895b6818fbb7ed4b0ef3df873f264bb2d1b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -97,9 +97,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -97,9 +97,15 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
@ -26,11 +26,15 @@ index 6b4163f5601a0961055c8451ec7ef2204938cf69..c54a37516ef1d8a76f7161917bf44812
if (flag) { if (flag) {
ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD);
@@ -223,7 +229,16 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo @@ -223,7 +229,20 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
public void readAdditionalSaveData(CompoundTag nbt) { public void readAdditionalSaveData(CompoundTag nbt) {
super.readAdditionalSaveData(nbt); super.readAdditionalSaveData(nbt);
this.reassessWeaponGoal(); this.reassessWeaponGoal();
+ this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); // Paper + // Paper start
+ if (nbt.contains("Paper.ShouldBurnInDay")) {
+ this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay");
+ }
+ // Paper end
+ } + }
+ +
+ // Paper start + // Paper start
@ -44,7 +48,7 @@ index 6b4163f5601a0961055c8451ec7ef2204938cf69..c54a37516ef1d8a76f7161917bf44812
@Override @Override
public void setItemSlot(EquipmentSlot slot, ItemStack stack) { public void setItemSlot(EquipmentSlot slot, ItemStack stack) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
index 460a848bd2a417d05a0bbb084371c98b661a427f..67f2d2f45138578646920ccae5b455a842a7b9e8 100644 index 460a848bd2a417d05a0bbb084371c98b661a427f..39291a0cea465613733a905141b584f05e597b4c 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
@@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -145,7 +145,7 @@ public class Phantom extends FlyingMob implements Enemy {
@ -56,15 +60,17 @@ index 460a848bd2a417d05a0bbb084371c98b661a427f..67f2d2f45138578646920ccae5b455a8
this.setSecondsOnFire(8); this.setSecondsOnFire(8);
} }
@@ -176,6 +176,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -176,6 +176,9 @@ public class Phantom extends FlyingMob implements Enemy {
if (nbt.hasUUID("Paper.SpawningEntity")) { if (nbt.hasUUID("Paper.SpawningEntity")) {
this.spawningEntity = nbt.getUUID("Paper.SpawningEntity"); this.spawningEntity = nbt.getUUID("Paper.SpawningEntity");
} }
+ this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); + if (nbt.contains("Paper.ShouldBurnInDay")) {
+ this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay");
+ }
// Paper end // Paper end
} }
@@ -190,6 +191,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -190,6 +193,7 @@ public class Phantom extends FlyingMob implements Enemy {
if (this.spawningEntity != null) { if (this.spawningEntity != null) {
nbt.putUUID("Paper.SpawningEntity", this.spawningEntity); nbt.putUUID("Paper.SpawningEntity", this.spawningEntity);
} }
@ -72,7 +78,7 @@ index 460a848bd2a417d05a0bbb084371c98b661a427f..67f2d2f45138578646920ccae5b455a8
// Paper end // Paper end
} }
@@ -249,6 +251,10 @@ public class Phantom extends FlyingMob implements Enemy { @@ -249,6 +253,10 @@ public class Phantom extends FlyingMob implements Enemy {
return spawningEntity; return spawningEntity;
} }
public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; } public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }