diff --git a/gradle.properties b/gradle.properties index 35e8e4a0bd..3e32f3207b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ org.gradle.daemon=false # Minecraft and Forge minecraft_version=1.20.6 -neo_version=20.6.40-beta +neo_version=20.6.72-beta # Version ranges for mods.toml minecraft_version_range=[1.20.6,1.21) diff --git a/src/machines/java/com/enderio/machines/common/blockentity/task/SpawnerMachineTask.java b/src/machines/java/com/enderio/machines/common/blockentity/task/SpawnerMachineTask.java index 819fc2a7d1..e315a2941b 100644 --- a/src/machines/java/com/enderio/machines/common/blockentity/task/SpawnerMachineTask.java +++ b/src/machines/java/com/enderio/machines/common/blockentity/task/SpawnerMachineTask.java @@ -26,12 +26,14 @@ import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.Mob; +import net.minecraft.world.entity.MobSpawnType; import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.phys.AABB; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.EventHooks; import net.neoforged.neoforge.event.TagsUpdatedEvent; +import net.neoforged.neoforge.event.entity.living.FinalizeSpawnEvent; import net.neoforged.neoforge.event.entity.living.MobSpawnEvent; import org.jetbrains.annotations.Nullable; @@ -207,12 +209,12 @@ public boolean trySpawnEntity(BlockPos pos, ServerLevel level) { } if (entity instanceof Mob mob) { // based on vanilla spawner - MobSpawnEvent.FinalizeSpawn event = EventHooks.onFinalizeSpawnSpawner(mob, level, level.getCurrentDifficultyAt(pos), null, null); - if (event == null || event.isSpawnCancelled()) { + FinalizeSpawnEvent event = EventHooks.finalizeMobSpawnSpawner(mob, level, level.getCurrentDifficultyAt(pos), MobSpawnType.SPAWNER, null, null, false); + if (event.isSpawnCancelled()) { blockEntity.setReason(PoweredSpawnerBlockEntity.SpawnerBlockedReason.OTHER_MOD); continue; } else { - EventHooks.onFinalizeSpawn(mob, level, event.getDifficulty(), event.getSpawnType(), event.getSpawnData()); + EventHooks.finalizeMobSpawn(mob, level, event.getDifficulty(), event.getSpawnType(), event.getSpawnData()); } }