Skip to content

Commit

Permalink
chore: Update to NeoForge 20.6.72-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Rover656 committed May 18, 2024
1 parent d80f870 commit 0eac012
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
}
}

Expand Down

0 comments on commit 0eac012

Please sign in to comment.