-
-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ Subject: [PATCH] API for any mob to burn daylight | |
Co-authored by: Encode42 <[email protected]> | ||
|
||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java | ||
index 62a38ecedbd579b32a8fd9cff5a433bfe635fc62..8473a7d9af9d83e97387ddf4cc50f6ad22730def 100644 | ||
index 4037d6445216bd16c778e4080e8c836400a35d96..95178c3a1de870709ea9d15a7d00c870d2edebff 100644 | ||
--- a/net/minecraft/world/entity/Entity.java | ||
+++ b/net/minecraft/world/entity/Entity.java | ||
@@ -530,6 +530,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess | ||
|
@@ -213,7 +213,7 @@ index 31eef2869945d9de565d627cac3fc1a5db380a2a..e618e716cb5ff3a3c5d284e985455694 | |
|
||
@Override | ||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java | ||
index 32b7c34d3c68dcfa936b628b2d038524204129a3..0ee817699fffbb929011465029182cc56befc30c 100644 | ||
index 32b7c34d3c68dcfa936b628b2d038524204129a3..41ae39349c6f7e6c5d0187257a72782c5dc4c8eb 100644 | ||
--- a/net/minecraft/world/entity/monster/Phantom.java | ||
+++ b/net/minecraft/world/entity/monster/Phantom.java | ||
@@ -60,6 +60,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
|
@@ -241,15 +241,24 @@ index 32b7c34d3c68dcfa936b628b2d038524204129a3..0ee817699fffbb929011465029182cc5 | |
@Override | ||
public boolean isFlapping() { | ||
return (this.getUniqueFlapTickOffset() + this.tickCount) % TICKS_PER_FLAP == 0; | ||
@@ -261,6 +272,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
@@ -261,15 +272,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
|
||
@Override | ||
public void aiStep() { | ||
- // Purpur start - Phantoms burn in light | ||
- boolean burnFromDaylight = this.shouldBurnInDay && this.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight; | ||
- boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight; | ||
- if (this.isAlive() && (burnFromDaylight || burnFromLightSource)) { // Paper - shouldBurnInDay API | ||
- // Purpur end - Phantoms burn in light | ||
- if (getRider() == null || !this.isControllable()) // Purpur - Ridables | ||
- this.igniteForSeconds(8.0F); | ||
- } | ||
- | ||
+ // Purpur - implemented in LivingEntity; moved down to shouldBurnInDay() - API for any mob to burn daylight | ||
// Purpur start - Phantoms burn in light | ||
boolean burnFromDaylight = this.shouldBurnInDay && this.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight; | ||
boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight; | ||
@@ -299,7 +311,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
super.aiStep(); | ||
} | ||
|
||
@@ -299,7 +302,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
if (compound.hasUUID("Paper.SpawningEntity")) { | ||
this.spawningEntity = compound.getUUID("Paper.SpawningEntity"); | ||
} | ||
|
@@ -258,7 +267,7 @@ index 32b7c34d3c68dcfa936b628b2d038524204129a3..0ee817699fffbb929011465029182cc5 | |
this.shouldBurnInDay = compound.getBoolean("Paper.ShouldBurnInDay"); | ||
} | ||
// Paper end | ||
@@ -316,7 +328,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
@@ -316,7 +319,7 @@ public class Phantom extends FlyingMob implements Enemy { | ||
if (this.spawningEntity != null) { | ||
compound.putUUID("Paper.SpawningEntity", this.spawningEntity); | ||
} | ||
|