This commit is contained in:
BillyGalbreath
2022-02-02 21:29:50 -06:00
parent d89923f642
commit a781baac3b
2 changed files with 6 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Phantoms burn in light
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 843c5bdc58a09aadab8d90f254e61a5cebe6388f..7e13097bb30578a9d083197dce06eecade4febf3 100644 index 843c5bdc58a09aadab8d90f254e61a5cebe6388f..e5305246287739232d6b7873a17884bffdf03514 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
@@ -50,6 +50,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -50,6 +50,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -23,7 +23,7 @@ index 843c5bdc58a09aadab8d90f254e61a5cebe6388f..7e13097bb30578a9d083197dce06eeca
- if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - Configurable Burning - if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - Configurable Burning
- if (getRider() == null || !this.isControllable()) // Purpur - if (getRider() == null || !this.isControllable()) // Purpur
+ // Purpur start + // Purpur start
+ boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight && this.isSunBurnTick(); + boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight;
+ boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight; + boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight;
+ if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - Configurable Burning + if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - Configurable Burning
+ if (getRider() == null || !this.isControllable()) + if (getRider() == null || !this.isControllable())

View File

@@ -29,7 +29,7 @@ index a0dfd64a6bd7da1e15abf12e82648d7d781152f5..cfe2230245d6b04619c886a46e3b4aca
// Purpur end // Purpur end
} }
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 461837b2c964c87542e01a0c1f7b379c01c2d76e..3abdaa13e39d647725b621d109f096b390bf04d9 100644 index 6710358370ade90410a836242862cd72703dba95..3f2af5dfa530b0a9e86b707aaec3218d63271c6d 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity { @@ -260,6 +260,7 @@ public abstract class LivingEntity extends Entity {
@@ -209,7 +209,7 @@ index 065005c13c2bff341402fc962d19148da27bc3c2..e394b6427329f48a85a277eeb8336b12
@Override @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 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 3122f7b826605f171bc1c88de89b358bd2e7118c..0c55953301d1d48f93dda432c22ac2798d1c3c2e 100644 index 5dd3f8df73bb02992b040f14d17c0861d715c5ba..273dc55813aef1a2285ac66703199626cf14c04b 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
@@ -60,6 +60,7 @@ public class Phantom extends FlyingMob implements Enemy { @@ -60,6 +60,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -225,7 +225,7 @@ index 3122f7b826605f171bc1c88de89b358bd2e7118c..0c55953301d1d48f93dda432c22ac279
@Override @Override
public void aiStep() { public void aiStep() {
- // Purpur start - // Purpur start
- boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight && this.isSunBurnTick(); - boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight;
- boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight; - boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight;
- if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - Configurable Burning - if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - Configurable Burning
- if (getRider() == null || !this.isControllable()) - if (getRider() == null || !this.isControllable())
@@ -264,7 +264,7 @@ index 3122f7b826605f171bc1c88de89b358bd2e7118c..0c55953301d1d48f93dda432c22ac279
+ // private boolean shouldBurnInDay = true; // Purpur - moved to LivingEntity - keep methods for ABI compatibility + // private boolean shouldBurnInDay = true; // Purpur - moved to LivingEntity - keep methods for ABI compatibility
+ // Purpur start + // Purpur start
+ public boolean shouldBurnInDay() { + public boolean shouldBurnInDay() {
+ boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight && this.isSunBurnTick(); + boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight;
+ boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight; + boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight;
+ return burnFromDaylight || burnFromLightSource; + return burnFromDaylight || burnFromLightSource;
+ } + }