Add phantom creative and insomniac controls
This commit is contained in:
@@ -24,10 +24,12 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -219,6 +229,17 @@
|
||||
return predicate.test(world, this, target);
|
||||
}
|
||||
@@ -217,7 +227,18 @@
|
||||
|
||||
boolean canAttack(ServerLevel world, LivingEntity target, TargetingConditions predicate) {
|
||||
return predicate.test(world, this, target);
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Nullable
|
||||
+ java.util.UUID spawningEntity;
|
||||
@@ -35,14 +37,13 @@
|
||||
+ @Nullable
|
||||
+ public java.util.UUID getSpawningEntity() {
|
||||
+ return this.spawningEntity;
|
||||
+ }
|
||||
}
|
||||
+ public void setSpawningEntity(java.util.UUID entity) { this.spawningEntity = entity; }
|
||||
+ // Paper end
|
||||
+
|
||||
|
||||
private static enum AttackPhase {
|
||||
|
||||
CIRCLE, SWOOP;
|
||||
@@ -522,14 +543,14 @@
|
||||
@@ -522,14 +543,15 @@
|
||||
List<Player> list = worldserver.getNearbyPlayers(this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0D, 64.0D, 16.0D));
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
@@ -55,6 +56,7 @@
|
||||
|
||||
if (Phantom.this.canAttack(worldserver, entityhuman, TargetingConditions.DEFAULT)) {
|
||||
- Phantom.this.setTarget(entityhuman);
|
||||
+ if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(entityhuman)) // Paper - Add phantom creative and insomniac controls
|
||||
+ Phantom.this.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit - reason
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user