mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Separate ridable and controllable configs
This commit is contained in:
@@ -6,10 +6,10 @@ Subject: [PATCH] API for any mob to burn daylight
|
||||
Co-authored by: Encode42 <me@encode42.dev>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index c709099a06f6cb9313c7e99f3b66b463b31e751a..ffccf99ae6eb4a20104ce897cb9f1a9356dd23c7 100644
|
||||
index 66788c374deb9a499841e0b28fcf34999e55c742..542d502ad0080e20971e1fddff54504dd23b0bf1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4431,5 +4431,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
@@ -4435,5 +4435,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i
|
||||
public boolean canSaveToDisk() {
|
||||
return true;
|
||||
}
|
||||
@@ -89,10 +89,10 @@ index 26717a4172ef299a3b4ab4384f8c23dc853bb485..12517438b8b8366a37165cb057dfc040
|
||||
|
||||
public boolean isSensitiveToWater() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index fa23e24708f4d9e1f50e54cda76113a9a7695c0a..e9aa614a7a93286e5077ffa43a8aebbaab6f4ac2 100644
|
||||
index 1060f3f27eb5cb205629e939c2a106dfa69d5626..487ceabadd9a38b89de64ccdfbd97ba6304c9ced 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1664,17 +1664,7 @@ public abstract class Mob extends LivingEntity {
|
||||
@@ -1662,17 +1662,7 @@ public abstract class Mob extends LivingEntity {
|
||||
}
|
||||
|
||||
public boolean isSunBurnTick() {
|
||||
@@ -188,7 +188,7 @@ index a60ca5d69a9734c7979f953bd56c05c7016356d2..193622015c6d3dbff787061e13fa098a
|
||||
// Paper end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Husk.java b/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
index 5458ac83fa555e22ca858f4f596ebb8f37926dd5..ca5683e9b0b4aad3827fe6d00198da8e5b6a69ec 100644
|
||||
index 065005c13c2bff341402fc962d19148da27bc3c2..e394b6427329f48a85a277eeb8336b12499525ee 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Husk.java
|
||||
@@ -20,6 +20,7 @@ public class Husk extends Zombie {
|
||||
@@ -199,7 +199,7 @@ index 5458ac83fa555e22ca858f4f596ebb8f37926dd5..ca5683e9b0b4aad3827fe6d00198da8e
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -70,7 +71,7 @@ public class Husk extends Zombie {
|
||||
@@ -75,7 +76,7 @@ public class Husk extends Zombie {
|
||||
|
||||
@Override
|
||||
public boolean isSunSensitive() {
|
||||
@@ -209,7 +209,7 @@ index 5458ac83fa555e22ca858f4f596ebb8f37926dd5..ca5683e9b0b4aad3827fe6d00198da8e
|
||||
|
||||
@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
|
||||
index 843335bcbdfef0c705dd95beeef8b4f61063f028..5979d8446ae71e365aa65871808af00fae316016 100644
|
||||
index 18b0a62a7ae7cf2413c319f402672ef2a6ee415f..2ae234b2e3f7949fe852d341a5feca9a6738075a 100644
|
||||
--- a/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 {
|
||||
@@ -220,16 +220,16 @@ index 843335bcbdfef0c705dd95beeef8b4f61063f028..5979d8446ae71e365aa65871808af00f
|
||||
}
|
||||
|
||||
// Purpur start
|
||||
@@ -249,7 +250,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -254,7 +255,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
- if (this.isAlive() && getRider() == null && (((shouldBurnInDay && level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getMaxLocalRawBrightness(blockPosition()) >= level.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||
+ if (this.isAlive() && getRider() == null && (((shouldBurnInDay() && level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getMaxLocalRawBrightness(blockPosition()) >= level.purpurConfig.phantomBurnInLight))) { // 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() && (getRider() == null || !this.isControllable()) && (((shouldBurnInDay() && level.purpurConfig.phantomBurnInDaylight) && this.isSunBurnTick()) || (level.purpurConfig.phantomBurnInLight > 0 && level.getMaxLocalRawBrightness(blockPosition()) >= level.purpurConfig.phantomBurnInLight))) { // Paper - Configurable Burning // Purpur
|
||||
this.setSecondsOnFire(8);
|
||||
}
|
||||
|
||||
@@ -281,7 +282,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -286,7 +287,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
this.spawningEntity = nbt.getUUID("Paper.SpawningEntity");
|
||||
}
|
||||
if (nbt.contains("Paper.ShouldBurnInDay")) {
|
||||
@@ -238,7 +238,7 @@ index 843335bcbdfef0c705dd95beeef8b4f61063f028..5979d8446ae71e365aa65871808af00f
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -297,7 +298,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -302,7 +303,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
if (this.spawningEntity != null) {
|
||||
nbt.putUUID("Paper.SpawningEntity", this.spawningEntity);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ index 843335bcbdfef0c705dd95beeef8b4f61063f028..5979d8446ae71e365aa65871808af00f
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -358,7 +359,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -363,7 +364,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
}
|
||||
public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
|
||||
|
||||
@@ -257,7 +257,7 @@ index 843335bcbdfef0c705dd95beeef8b4f61063f028..5979d8446ae71e365aa65871808af00f
|
||||
public void setShouldBurnInDay(boolean shouldBurnInDay) { this.shouldBurnInDay = shouldBurnInDay; }
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index e4ead1ced18f16715440c8562a89d7d359add98e..9a4806baab135128f30ad9be4369bbe1e543c6df 100644
|
||||
index 4b288fe8923bb4beefb88e8196bfb4d5d2b10b8b..e4e357af439c9a02b8013ce3349ff582495ee80e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -93,11 +93,12 @@ public class Zombie extends Monster {
|
||||
@@ -274,7 +274,7 @@ index e4ead1ced18f16715440c8562a89d7d359add98e..9a4806baab135128f30ad9be4369bbe1
|
||||
}
|
||||
|
||||
public Zombie(Level world) {
|
||||
@@ -289,30 +290,7 @@ public class Zombie extends Monster {
|
||||
@@ -294,30 +295,7 @@ public class Zombie extends Monster {
|
||||
|
||||
@Override
|
||||
public void aiStep() {
|
||||
@@ -306,7 +306,7 @@ index e4ead1ced18f16715440c8562a89d7d359add98e..9a4806baab135128f30ad9be4369bbe1
|
||||
super.aiStep();
|
||||
}
|
||||
|
||||
@@ -350,6 +328,7 @@ public class Zombie extends Monster {
|
||||
@@ -355,6 +333,7 @@ public class Zombie extends Monster {
|
||||
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ index e4ead1ced18f16715440c8562a89d7d359add98e..9a4806baab135128f30ad9be4369bbe1
|
||||
public boolean isSunSensitive() {
|
||||
return this.shouldBurnInDay; // Paper - use api value instead
|
||||
}
|
||||
@@ -479,7 +458,7 @@ public class Zombie extends Monster {
|
||||
@@ -484,7 +463,7 @@ public class Zombie extends Monster {
|
||||
nbt.putBoolean("CanBreakDoors", this.canBreakDoors());
|
||||
nbt.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
|
||||
nbt.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
|
||||
@@ -323,7 +323,7 @@ index e4ead1ced18f16715440c8562a89d7d359add98e..9a4806baab135128f30ad9be4369bbe1
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -493,7 +472,7 @@ public class Zombie extends Monster {
|
||||
@@ -498,7 +477,7 @@ public class Zombie extends Monster {
|
||||
}
|
||||
// Paper start
|
||||
if (nbt.contains("Paper.ShouldBurnInDay")) {
|
||||
|
||||
Reference in New Issue
Block a user