Separate ridable and controllable configs

This commit is contained in:
BillyGalbreath
2022-01-18 09:10:04 -06:00
parent 0a9a17044b
commit bd0a85a17c
94 changed files with 2558 additions and 1857 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 61b40d0b7dbb956fa25271c6f6768ac147afc563..72a790e6aba656e8817a84d2c729ce722e9a43ef 100644
index 7361634f6eb65be5f04c00686be30e3e12d1bc0e..20ff9c65f89635a4b91d334775b3ac380b5ccbac 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,16 @@ index 61b40d0b7dbb956fa25271c6f6768ac147afc563..72a790e6aba656e8817a84d2c729ce72
public Phantom(EntityType<? extends Phantom> type, Level world) {
super(type, world);
@@ -242,7 +243,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -247,7 +248,7 @@ public class Phantom extends FlyingMob implements Enemy {
@Override
public void aiStep() {
- if (this.isAlive() && getRider() == null && shouldBurnInDay && this.isSunBurnTick()) { // 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 && 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
this.setSecondsOnFire(8);
}
@@ -646,6 +647,12 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -651,6 +652,12 @@ public class Phantom extends FlyingMob implements Enemy {
return false;
} else if (!entityliving.isAlive()) {
return false;
@@ -38,7 +38,7 @@ index 61b40d0b7dbb956fa25271c6f6768ac147afc563..72a790e6aba656e8817a84d2c729ce72
} else {
if (entityliving instanceof Player) {
Player entityhuman = (Player) entityliving;
@@ -791,6 +798,7 @@ public class Phantom extends FlyingMob implements Enemy {
@@ -796,6 +803,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));
@@ -47,10 +47,10 @@ index 61b40d0b7dbb956fa25271c6f6768ac147afc563..72a790e6aba656e8817a84d2c729ce72
list.sort(Comparator.comparing((Entity e) -> { return e.getY(); }).reversed()); // CraftBukkit - decompile error
Iterator iterator = list.iterator();
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index e31ed42038f800125f2129b1dbfafa86eacbf1b9..e2aa7524253adecd6536530d93f68e75482af97f 100644
index e480e61419a9b83e98fcd0ba8a949c20a241c949..249368f0808871eafa8b3dfd48f631a8d55a74f0 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1018,6 +1018,9 @@ public class PurpurWorldConfig {
@@ -1085,6 +1085,9 @@ public class PurpurWorldConfig {
public int phantomSpawnOverheadRadius = 10;
public int phantomSpawnMinPerAttempt = 1;
public int phantomSpawnMaxPerAttempt = -1;
@@ -60,7 +60,7 @@ index e31ed42038f800125f2129b1dbfafa86eacbf1b9..e2aa7524253adecd6536530d93f68e75
private void phantomSettings() {
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
@@ -1053,6 +1056,9 @@ public class PurpurWorldConfig {
@@ -1121,6 +1124,9 @@ public class PurpurWorldConfig {
phantomSpawnOverheadRadius = getInt("mobs.phantom.spawn.overhead.radius", phantomSpawnOverheadRadius);
phantomSpawnMinPerAttempt = getInt("mobs.phantom.spawn.per-attempt.min", phantomSpawnMinPerAttempt);
phantomSpawnMaxPerAttempt = getInt("mobs.phantom.spawn.per-attempt.max", phantomSpawnMaxPerAttempt);