This commit is contained in:
BillyGalbreath
2022-01-25 17:31:31 -06:00
parent d3c6faa749
commit 414cf7d035
6 changed files with 94 additions and 37 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
index 7361634f6eb65be5f04c00686be30e3e12d1bc0e..20ff9c65f89635a4b91d334775b3ac380b5ccbac 100644
index 843c5bdc58a09aadab8d90f254e61a5cebe6388f..7e13097bb30578a9d083197dce06eecade4febf3 100644
--- a/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 {
@@ -16,16 +16,22 @@ index 7361634f6eb65be5f04c00686be30e3e12d1bc0e..20ff9c65f89635a4b91d334775b3ac38
public Phantom(EntityType<? extends Phantom> type, Level world) {
super(type, world);
@@ -247,7 +248,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -247,8 +248,12 @@ public class Phantom extends FlyingMob implements Enemy {
@Override
public void aiStep() {
- if (this.isAlive() && (getRider() == null || !this.isControllable()) && shouldBurnInDay && this.isSunBurnTick()) { // 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
- if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - Configurable Burning
- if (getRider() == null || !this.isControllable()) // Purpur
+ // 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);
}
@@ -651,6 +652,12 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -652,6 +657,12 @@ public class Phantom extends FlyingMob implements Enemy {
return false;
} else if (!entityliving.isAlive()) {
return false;
@@ -38,7 +44,7 @@ index 7361634f6eb65be5f04c00686be30e3e12d1bc0e..20ff9c65f89635a4b91d334775b3ac38
} else {
if (entityliving instanceof Player) {
Player entityhuman = (Player) entityliving;
@@ -796,6 +803,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -797,6 +808,7 @@ public class Phantom extends FlyingMob implements Enemy {
this.nextScanTick = reducedTickDelay(60);
List<Player> list = Phantom.this.level.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0D, 64.0D, 16.0D));