Skip to content

Commit

Permalink
Don't spawn if lastSpawnState is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Aug 28, 2024
1 parent 351bb33 commit 5eec2e9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions patches/server/0100-Don-t-spawn-if-lastSpawnState-is-null.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Tue, 27 Aug 2024 22:53:08 -0400
Subject: [PATCH] Don't spawn if lastSpawnState is null


diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index ef2d70c1bd21cff6a080205c38bbe8bf18cc80a4..8ccc6631367992e6cb64c41b2716e743074ff913 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -500,7 +500,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon

if (true && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair)) { // Paper - rewrite chunk system
chunk1.incrementInhabitedTime(j);
- if (flagAndHasNaturalSpawn && (!org.dreeam.leaf.config.modules.async.AsyncMobSpawning.enabled || _pufferfish_spawnCountsReady.get()) && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair, true)) { // Spigot // Gale - MultiPaper - skip unnecessary mob spawning computations // Pufferfish
+ if (flagAndHasNaturalSpawn && lastSpawnState != null && (!org.dreeam.leaf.config.modules.async.AsyncMobSpawning.enabled || _pufferfish_spawnCountsReady.get()) && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair, true)) { // Spigot // Gale - MultiPaper - skip unnecessary mob spawning computations // Pufferfish // Leaf - Don't spawn if lastSpawnState is null
NaturalSpawner.spawnForChunk(this.level, chunk1, lastSpawnState, this.spawnFriendlies, this.spawnEnemies, flag1); // Pufferfish
}

0 comments on commit 5eec2e9

Please sign in to comment.