mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-06-23 10:47:47 +02:00
Upstream Paper's upgrade to vineflower 12.0.0 (#1782)
This commit is contained in:
@@ -5,10 +5,10 @@ Subject: [PATCH] Phantoms burn in light
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index 962539961aeb73914f5d250afa7a4109765bf438..b3a79a6387fbf00c97da4452cb48e4808e5391be 100644
|
||||
index 1474d005d8333f592856ba4cdfc396cb4b93159a..03db90080675c879688c37e568dc25603b4972b1 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -55,6 +55,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -54,6 +54,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
public java.util.@Nullable UUID spawningEntity;
|
||||
public boolean shouldBurnInDay = true;
|
||||
// Paper end
|
||||
@@ -16,7 +16,7 @@ index 962539961aeb73914f5d250afa7a4109765bf438..b3a79a6387fbf00c97da4452cb48e480
|
||||
|
||||
public Phantom(final EntityType<? extends Phantom> type, final Level level) {
|
||||
super(type, level);
|
||||
@@ -239,7 +240,11 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -238,7 +239,11 @@ public class Phantom extends Mob implements Enemy {
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean isSunBurnTick() {
|
||||
@@ -29,15 +29,17 @@ index 962539961aeb73914f5d250afa7a4109765bf438..b3a79a6387fbf00c97da4452cb48e480
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -362,6 +367,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
this.nextScanTick = reducedTickDelay(60);
|
||||
ServerLevel level = getServerLevel(Phantom.this.level());
|
||||
List<Player> players = level.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0, 64.0, 16.0));
|
||||
+ if (level().purpurConfig.phantomIgnorePlayersWithTorch) players.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND))); // Purpur - Phantoms burn in light
|
||||
if (!players.isEmpty()) {
|
||||
players.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed());
|
||||
@@ -355,7 +360,8 @@ public class Phantom extends Mob implements Enemy {
|
||||
this.nextScanTick = reducedTickDelay(60);
|
||||
ServerLevel level = getServerLevel(Phantom.this.level());
|
||||
List<Player> players = level.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0, 64.0, 16.0));
|
||||
- if (!players.isEmpty()) {
|
||||
+ if (level().purpurConfig.phantomIgnorePlayersWithTorch) players.removeIf(human -> TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.MAIN_HAND)) || TORCH.test(human.getItemInHand(net.minecraft.world.InteractionHand.OFF_HAND))); // Purpur - Phantoms burn in light
|
||||
+ if (!players.isEmpty()) {
|
||||
players.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed());
|
||||
|
||||
@@ -752,6 +758,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
for (Player player : players) {
|
||||
@@ -724,6 +730,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
return false;
|
||||
} else if (!target.isAlive()) {
|
||||
return false;
|
||||
@@ -49,4 +51,4 @@ index 962539961aeb73914f5d250afa7a4109765bf438..b3a79a6387fbf00c97da4452cb48e480
|
||||
+ // Purpur end - Phantoms burn in light
|
||||
} else if (target instanceof Player player && (target.isSpectator() || player.isCreative())) {
|
||||
return false;
|
||||
} else if (!this.canUse()) {
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user