2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/MobSpawnerAbstract.java
|
|
|
|
+++ b/net/minecraft/world/level/MobSpawnerAbstract.java
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -54,6 +54,7 @@
|
2017-08-08 04:46:59 +02:00
|
|
|
|
2022-12-07 17:00:00 +01:00
|
|
|
public void setEntityId(EntityTypes<?> entitytypes, @Nullable World world, RandomSource randomsource, BlockPosition blockposition) {
|
|
|
|
this.getOrCreateNextSpawnData(world, randomsource, blockposition).getEntityToSpawn().putString("id", BuiltInRegistries.ENTITY_TYPE.getKey(entitytypes).toString());
|
2021-11-21 23:00:00 +01:00
|
|
|
+ this.spawnPotentials = SimpleWeightedRandomList.empty(); // CraftBukkit - SPIGOT-3496, MC-92282
|
2017-08-08 04:46:59 +02:00
|
|
|
}
|
2018-07-15 02:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
private boolean isNearPlayer(World world, BlockPosition blockposition) {
|
2024-04-23 17:15:00 +02:00
|
|
|
@@ -157,13 +158,18 @@
|
|
|
|
((EntityInsentient) entity).finalizeSpawn(worldserver, worldserver.getCurrentDifficultyAt(entity.blockPosition()), EnumMobSpawn.SPAWNER, (GroupDataEntity) null);
|
2020-08-11 23:00:00 +02:00
|
|
|
}
|
2024-04-23 17:15:00 +02:00
|
|
|
|
|
|
|
- Optional optional1 = mobspawnerdata.getEquipment();
|
|
|
|
+ Optional<net.minecraft.world.entity.EquipmentTable> optional1 = mobspawnerdata.getEquipment(); // CraftBukkit - decompile error
|
|
|
|
|
|
|
|
Objects.requireNonNull(entityinsentient);
|
|
|
|
optional1.ifPresent(entityinsentient::equip);
|
2021-06-11 07:00:00 +02:00
|
|
|
}
|
2016-02-29 22:32:46 +01:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- if (!worldserver.tryAddFreshEntityWithPassengers(entity)) {
|
2023-06-09 23:22:51 +02:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ if (!worldserver.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) {
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
this.delay(worldserver, blockposition);
|
2021-06-11 07:00:00 +02:00
|
|
|
return;
|
|
|
|
}
|