mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
save stuff here
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 5a44bead0ad10deb4ec7d90c86305ae178632e6c..b230733d72843f3142c26cc7d0e9bf93054fc628 100644
|
||||
index cd6a25bb101555d6c763a7023d1b05691e671b5f..67aa490540d264775d8a8382cb5922f365ca6913 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -49,6 +49,7 @@ public class Phantom extends FlyingMob implements Enemy {
|
||||
@@ -22,8 +22,8 @@ index 5a44bead0ad10deb4ec7d90c86305ae178632e6c..b230733d72843f3142c26cc7d0e9bf93
|
||||
public void aiStep() {
|
||||
- if (this.isAlive() && shouldBurnInDay && this.isSunBurnTick()) { // Paper - Configurable Burning
|
||||
+ // Purpur start
|
||||
+ boolean burnFromDaylight = this.shouldBurnInDay && this.level.purpurConfig.phantomBurnInDaylight;
|
||||
+ boolean burnFromLightSource = this.level.purpurConfig.phantomBurnInLight > 0 && this.level.getMaxLocalRawBrightness(blockPosition()) >= this.level.purpurConfig.phantomBurnInLight;
|
||||
+ boolean burnFromDaylight = this.shouldBurnInDay && 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 - Configurable Burning
|
||||
+ if (getRider() == null || !this.isControllable())
|
||||
+ // Purpur end
|
||||
@@ -35,9 +35,9 @@ index 5a44bead0ad10deb4ec7d90c86305ae178632e6c..b230733d72843f3142c26cc7d0e9bf93
|
||||
} else if (!entityliving.isAlive()) {
|
||||
return false;
|
||||
+ // Purpur start
|
||||
+ } else if (level.purpurConfig.phantomBurnInLight > 0 && level.getLightEmission(new BlockPos(Phantom.this)) >= level.purpurConfig.phantomBurnInLight) {
|
||||
+ } else if (level().purpurConfig.phantomBurnInLight > 0 && level.getLightEmission(new BlockPos(Phantom.this)) >= level().purpurConfig.phantomBurnInLight) {
|
||||
+ return false;
|
||||
+ } else if (level.purpurConfig.phantomIgnorePlayersWithTorch && (TORCH.test(entityliving.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(entityliving.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)))) {
|
||||
+ } else if (level().purpurConfig.phantomIgnorePlayersWithTorch && (TORCH.test(entityliving.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(entityliving.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)))) {
|
||||
+ return false;
|
||||
+ // Purpur end
|
||||
} else {
|
||||
@@ -47,15 +47,15 @@ index 5a44bead0ad10deb4ec7d90c86305ae178632e6c..b230733d72843f3142c26cc7d0e9bf93
|
||||
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));
|
||||
|
||||
+ if (level.purpurConfig.phantomIgnorePlayersWithTorch) list.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)));// Purpur
|
||||
+ if (level().purpurConfig.phantomIgnorePlayersWithTorch) list.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND)));// Purpur
|
||||
if (!list.isEmpty()) {
|
||||
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 31ff1a1e9f57f6d5bef77dc1038b5bc51a53ac6f..4f5f144127787b5deaca89f5fa97551c8caf4c28 100644
|
||||
index 8c2241cd2670ff4d945d3953dcc227cc63d5b7e0..93aaa9d4413e10af4cb1fca15bc9627a7ded3955 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -875,6 +875,9 @@ public class PurpurWorldConfig {
|
||||
@@ -1122,6 +1122,9 @@ public class PurpurWorldConfig {
|
||||
public double phantomSpawnLocalDifficultyChance = 3.0D;
|
||||
public int phantomSpawnMinPerAttempt = 1;
|
||||
public int phantomSpawnMaxPerAttempt = -1;
|
||||
@@ -63,9 +63,9 @@ index 31ff1a1e9f57f6d5bef77dc1038b5bc51a53ac6f..4f5f144127787b5deaca89f5fa97551c
|
||||
+ public boolean phantomIgnorePlayersWithTorch = false;
|
||||
+ public boolean phantomBurnInDaylight = true;
|
||||
private void phantomSettings() {
|
||||
if (PurpurConfig.version < 10) {
|
||||
double oldValue = getDouble("mobs.phantom.attributes.max-health", Double.parseDouble(phantomMaxHealth));
|
||||
@@ -895,6 +898,9 @@ public class PurpurWorldConfig {
|
||||
phantomRidable = getBoolean("mobs.phantom.ridable", phantomRidable);
|
||||
phantomRidableInWater = getBoolean("mobs.phantom.ridable-in-water", phantomRidableInWater);
|
||||
@@ -1149,6 +1152,9 @@ public class PurpurWorldConfig {
|
||||
phantomSpawnLocalDifficultyChance = getDouble("mobs.phantom.spawn.local-difficulty-chance", phantomSpawnLocalDifficultyChance);
|
||||
phantomSpawnMinPerAttempt = getInt("mobs.phantom.spawn.per-attempt.min", phantomSpawnMinPerAttempt);
|
||||
phantomSpawnMaxPerAttempt = getInt("mobs.phantom.spawn.per-attempt.max", phantomSpawnMaxPerAttempt);
|
||||
@@ -74,4 +74,4 @@ index 31ff1a1e9f57f6d5bef77dc1038b5bc51a53ac6f..4f5f144127787b5deaca89f5fa97551c
|
||||
+ phantomIgnorePlayersWithTorch = getBoolean("mobs.phantom.ignore-players-with-torch", phantomIgnorePlayersWithTorch);
|
||||
}
|
||||
|
||||
public double pigMaxHealth = 10.0D;
|
||||
public boolean pigRidable = false;
|
||||
|
||||
Reference in New Issue
Block a user