mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Fix #868
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user