Somehow a bunch of items were missed

This commit is contained in:
Jake Potrebic
2024-12-14 22:35:35 -08:00
parent 35afd218f5
commit 172a80cb66
25 changed files with 475 additions and 25 deletions

View File

@@ -217,7 +217,7 @@
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
- Entity nearestPlayer = this.level().getNearestPlayer(this, -1.0);
+ Entity nearestPlayer = this.level().getNearestPlayer(this, -1.0, EntitySelector.PLAYER_AFFECTS_SPAWNING); // Paper - Affects Spawning API
+ Entity nearestPlayer = this.level().findNearbyPlayer(this, -1.0, EntitySelector.PLAYER_AFFECTS_SPAWNING); // Paper - Affects Spawning API
if (nearestPlayer != null) {
- double d = nearestPlayer.distanceToSqr(this);
- int despawnDistance = this.getType().getCategory().getDespawnDistance();
@@ -320,7 +320,7 @@
this.setItemSlot(equipmentSlot, ItemStack.EMPTY);
+ // Paper start
+ } else {
+ this.clearedEquipmentSlots.add(enumitemslot);
+ this.clearedEquipmentSlots.add(equipmentSlot);
+ }
+ // Paper end
}
@@ -338,7 +338,7 @@
+ EntityType<T> entityType, ConversionParams conversionParams, EntitySpawnReason spawnReason, ConversionParams.AfterConversion<T> afterConversion, EntityTransformEvent.TransformReason transformReason, CreatureSpawnEvent.SpawnReason creatureSpawnReason
+ ) {
+ // Paper start - entity zap event - allow cancellation of conversion post creation
+ return this.convertTo(entityType, conversionParams, spawnReason, e -> { afterConversion.finalizeConversion(e); return true; }, transformReason, spawnReason);
+ return this.convertTo(entityType, conversionParams, spawnReason, e -> { afterConversion.finalizeConversion(e); return true; }, transformReason, creatureSpawnReason);
+ }
+ @Nullable
+ public <T extends Mob> T convertTo(