@@ -206,12 +206,7 @@ protected static boolean chunkWithinRadius(Player player, int chunkX, int chunkZ
206206 );
207207 }
208208
209- private static final int ATTEMPT_GENERATE_COOLDOWN = Global .TICKS_PER_SECOND * 2 ;
210- private static int currGenerateCooldown = 0 ;
211-
212209 public static void onWorldTick (World world ) {
213- currGenerateCooldown --;
214-
215210 List <Player > players ;
216211 if (EnvironmentHelper .isServerEnvironment ()) {
217212 // thx java!
@@ -221,23 +216,21 @@ public static void onWorldTick(World world) {
221216 players = world .players ;
222217 }
223218
224- if ( currGenerateCooldown <= 0 ) {
225- for (Player player : players ) {
226- for ( DungeonLogic dungeonLogic : DUNGEON_MAP . values ()) {
227- if (
228- dungeonLogic != null
229- && dungeonLogic .getDimensionID () == world . dimension . id
230- && ! dungeonLogic . isGenerated ()
231- && chunkWithinRadius (
232- player ,
233- Math .floorDiv (dungeonLogic .position .getX (), Chunk .CHUNK_SIZE_X ),
234- Math . floorDiv ( dungeonLogic . position . getZ (), Chunk . CHUNK_SIZE_Z )
235- )
236- ) { dungeonLogic .generate (world ); }
219+ for ( Player player : players ) {
220+ for (DungeonLogic dungeonLogic : DUNGEON_MAP . values () ) {
221+ if (
222+ dungeonLogic != null
223+ && dungeonLogic . getDimensionID () == world . dimension . id
224+ && ! dungeonLogic .isGenerated ()
225+ && chunkWithinRadius (
226+ player ,
227+ Math . floorDiv ( dungeonLogic . position . getX (), Chunk . CHUNK_SIZE_X ) ,
228+ Math .floorDiv (dungeonLogic .position .getZ (), Chunk .CHUNK_SIZE_Z )
229+ )
230+ ) {
231+ dungeonLogic .generate (world );
237232 }
238233 }
239-
240- currGenerateCooldown = ATTEMPT_GENERATE_COOLDOWN ;
241234 }
242235
243236 for (DungeonLogic logic : DUNGEON_MAP .values ()) {
0 commit comments