mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-22 10:57:43 +01:00
add back removed options
This commit is contained in:
@@ -4,24 +4,8 @@ Date: Sun, 12 Apr 2020 20:41:59 -0700
|
||||
Subject: [PATCH] Phantoms burn in light
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index d8faed1fc3ead010f0abd8ffdf3428881472a25c..a3569262099dce237c3feb5e29d24bf47f4c1e38 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -581,7 +581,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
}
|
||||
|
||||
private void burnUndead() {
|
||||
- if (this.isAlive() && this.isSunBurnTick()) {
|
||||
+ // Purpur start - Phantoms burn in light
|
||||
+ boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this instanceof net.minecraft.world.entity.monster.Phantom && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
|
||||
+ if (this.isAlive() && (this.isSunBurnTick() || burnFromLightSource)) {
|
||||
+ // Purpur end - Phantoms burn in light
|
||||
EquipmentSlot equipmentSlot = this.sunProtectionSlot();
|
||||
ItemStack itemBySlot = this.getItemBySlot(equipmentSlot);
|
||||
if (!itemBySlot.isEmpty()) {
|
||||
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
|
||||
index 7077beafe2251fcc4e37578091bfaa02714268b9..e55470432cebddec43a7d63230eb4391a3d42f8e 100644
|
||||
index 7077beafe2251fcc4e37578091bfaa02714268b9..6e8fe1b694ade45ffbf0b9bb39b954deffeb2402 100644
|
||||
--- a/net/minecraft/world/entity/monster/Phantom.java
|
||||
+++ b/net/minecraft/world/entity/monster/Phantom.java
|
||||
@@ -54,6 +54,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -32,7 +16,20 @@ index 7077beafe2251fcc4e37578091bfaa02714268b9..e55470432cebddec43a7d63230eb4391
|
||||
|
||||
public Phantom(EntityType<? extends Phantom> type, Level level) {
|
||||
super(type, level);
|
||||
@@ -366,6 +367,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -238,7 +239,11 @@ public class Phantom extends Mob implements Enemy {
|
||||
// Paper start
|
||||
@Override
|
||||
public boolean isSunBurnTick() {
|
||||
- return this.shouldBurnInDay && super.isSunBurnTick();
|
||||
+ // Purpur start - API for any mob to burn daylight
|
||||
+ boolean burnFromDaylight = this.shouldBurnInDay && super.isSunBurnTick() && this.level().purpurConfig.phantomBurnInDaylight;
|
||||
+ boolean burnFromLightSource = this.level().purpurConfig.phantomBurnInLight > 0 && this.level().getMaxLocalRawBrightness(blockPosition()) >= this.level().purpurConfig.phantomBurnInLight;
|
||||
+ return burnFromDaylight || burnFromLightSource;
|
||||
+ // Purpur end - API for any mob to burn daylight
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -366,6 +371,7 @@ public class Phantom extends Mob implements Enemy {
|
||||
List<Player> nearbyPlayers = serverLevel.getNearbyPlayers(
|
||||
this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0, 64.0, 16.0)
|
||||
);
|
||||
@@ -40,7 +37,7 @@ index 7077beafe2251fcc4e37578091bfaa02714268b9..e55470432cebddec43a7d63230eb4391
|
||||
if (!nearbyPlayers.isEmpty()) {
|
||||
nearbyPlayers.sort(Comparator.<Player, Double>comparing(Entity::getY).reversed());
|
||||
|
||||
@@ -736,6 +738,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
@@ -736,6 +742,12 @@ public class Phantom extends Mob implements Enemy {
|
||||
return false;
|
||||
} else if (!target.isAlive()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user