mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Fix #868
This commit is contained in:
@@ -209,7 +209,7 @@ index 065005c13c2bff341402fc962d19148da27bc3c2..e394b6427329f48a85a277eeb8336b12
|
||||
|
||||
@Override
|
||||
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 18b0a62a7ae7cf2413c319f402672ef2a6ee415f..2ae234b2e3f7949fe852d341a5feca9a6738075a 100644
|
||||
index 3122f7b826605f171bc1c88de89b358bd2e7118c..0c55953301d1d48f93dda432c22ac2798d1c3c2e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -60,6 +60,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -220,25 +220,33 @@ index 18b0a62a7ae7cf2413c319f402672ef2a6ee415f..2ae234b2e3f7949fe852d341a5feca9a
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -254,7 +255,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -254,15 +255,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
- if (this.isAlive() && (getRider() == null || !this.isControllable()) && (((shouldBurnInDay && level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getMaxLocalRawBrightness(blockPosition()) >= level.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||
+ if (this.isAlive() && (getRider() == null || !this.isControllable()) && (((shouldBurnInDay() && level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getMaxLocalRawBrightness(blockPosition()) >= level.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||
this.setSecondsOnFire(8);
|
||||
}
|
||||
- // Purpur start
|
||||
- boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight && this.isSunBurnTick();
|
||||
- boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight;
|
||||
- if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - Configurable Burning
|
||||
- if (getRider() == null || !this.isControllable())
|
||||
- // Purpur end
|
||||
- this.setSecondsOnFire(8);
|
||||
- }
|
||||
-
|
||||
+ // Purpur - moved down to shouldBurnInDay()
|
||||
super.aiStep();
|
||||
}
|
||||
|
||||
@@ -286,7 +287,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -290,7 +283,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
if (nbt.hasUUID("Paper.SpawningEntity")) {
|
||||
this.spawningEntity = nbt.getUUID("Paper.SpawningEntity");
|
||||
}
|
||||
if (nbt.contains("Paper.ShouldBurnInDay")) {
|
||||
- this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay");
|
||||
+ // this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay"); // Purpur - implemented in LivingEntity
|
||||
- if (nbt.contains("Paper.ShouldBurnInDay")) {
|
||||
+ if (false && nbt.contains("Paper.ShouldBurnInDay")) { // Purpur - implemented in LivingEntity
|
||||
this.shouldBurnInDay = nbt.getBoolean("Paper.ShouldBurnInDay");
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -302,7 +303,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -307,7 +300,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
if (this.spawningEntity != null) {
|
||||
nbt.putUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||
}
|
||||
@@ -247,15 +255,23 @@ index 18b0a62a7ae7cf2413c319f402672ef2a6ee415f..2ae234b2e3f7949fe852d341a5feca9a
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -363,7 +364,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -368,8 +361,14 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
}
|
||||
public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
|
||||
|
||||
- private boolean shouldBurnInDay = true;
|
||||
- public boolean shouldBurnInDay() { return shouldBurnInDay; }
|
||||
+ // private boolean shouldBurnInDay = true; // Purpur - moved to LivingEntity - keep methods for ABI compatibility
|
||||
public boolean shouldBurnInDay() { return shouldBurnInDay; }
|
||||
+ // Purpur start
|
||||
+ public boolean shouldBurnInDay() {
|
||||
+ boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight && this.isSunBurnTick();
|
||||
+ boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight;
|
||||
+ return burnFromDaylight || burnFromLightSource;
|
||||
+ }
|
||||
+ // Purpur End
|
||||
public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }
|
||||
// Paper end
|
||||
private static enum AttackPhase {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 4b288fe8923bb4beefb88e8196bfb4d5d2b10b8b..e4e357af439c9a02b8013ce3349ff582495ee80e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
|
||||
Reference in New Issue
Block a user