Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit 71f219d

Browse files
committed
missing diff in daylight api patch
1 parent 9680ad8 commit 71f219d

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

purpur-server/minecraft-patches/features/0019-API-for-any-mob-to-burn-daylight.patch

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Subject: [PATCH] API for any mob to burn daylight
66
Co-authored by: Encode42 <me@encode42.dev>
77

88
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
9-
index 62a38ecedbd579b32a8fd9cff5a433bfe635fc62..8473a7d9af9d83e97387ddf4cc50f6ad22730def 100644
9+
index 4037d6445216bd16c778e4080e8c836400a35d96..95178c3a1de870709ea9d15a7d00c870d2edebff 100644
1010
--- a/net/minecraft/world/entity/Entity.java
1111
+++ b/net/minecraft/world/entity/Entity.java
1212
@@ -530,6 +530,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -213,7 +213,7 @@ index 31eef2869945d9de565d627cac3fc1a5db380a2a..e618e716cb5ff3a3c5d284e985455694
213213

214214
@Override
215215
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
216-
index 32b7c34d3c68dcfa936b628b2d038524204129a3..0ee817699fffbb929011465029182cc56befc30c 100644
216+
index 32b7c34d3c68dcfa936b628b2d038524204129a3..41ae39349c6f7e6c5d0187257a72782c5dc4c8eb 100644
217217
--- a/net/minecraft/world/entity/monster/Phantom.java
218218
+++ b/net/minecraft/world/entity/monster/Phantom.java
219219
@@ -60,6 +60,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -241,15 +241,24 @@ index 32b7c34d3c68dcfa936b628b2d038524204129a3..0ee817699fffbb929011465029182cc5
241241
@Override
242242
public boolean isFlapping() {
243243
return (this.getUniqueFlapTickOffset() + this.tickCount) % TICKS_PER_FLAP == 0;
244-
@@ -261,6 +272,7 @@ public class Phantom extends FlyingMob implements Enemy {
244+
@@ -261,15 +272,7 @@ public class Phantom extends FlyingMob implements Enemy {
245245

246246
@Override
247247
public void aiStep() {
248+
- // Purpur start - Phantoms burn in light
249+
- boolean burnFromDaylight = this.shouldBurnInDay && this.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight;
250+
- boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
251+
- if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - shouldBurnInDay API
252+
- // Purpur end - Phantoms burn in light
253+
- if (getRider() == null || !this.isControllable()) // Purpur - Ridables
254+
- this.igniteForSeconds(8.0F);
255+
- }
256+
-
248257
+ // Purpur - implemented in LivingEntity; moved down to shouldBurnInDay() - API for any mob to burn daylight
249-
// Purpur start - Phantoms burn in light
250-
boolean burnFromDaylight = this.shouldBurnInDay && this.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight;
251-
boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
252-
@@ -299,7 +311,7 @@ public class Phantom extends FlyingMob implements Enemy {
258+
super.aiStep();
259+
}
260+
261+
@@ -299,7 +302,7 @@ public class Phantom extends FlyingMob implements Enemy {
253262
if (compound.hasUUID("Paper.SpawningEntity")) {
254263
this.spawningEntity = compound.getUUID("Paper.SpawningEntity");
255264
}
@@ -258,7 +267,7 @@ index 32b7c34d3c68dcfa936b628b2d038524204129a3..0ee817699fffbb929011465029182cc5
258267
this.shouldBurnInDay = compound.getBoolean("Paper.ShouldBurnInDay");
259268
}
260269
// Paper end
261-
@@ -316,7 +328,7 @@ public class Phantom extends FlyingMob implements Enemy {
270+
@@ -316,7 +319,7 @@ public class Phantom extends FlyingMob implements Enemy {
262271
if (this.spawningEntity != null) {
263272
compound.putUUID("Paper.SpawningEntity", this.spawningEntity);
264273
}

0 commit comments

Comments
 (0)