@@ -345,17 +345,15 @@ public static void postChunkTick(ServerWorld world) {
345345 }
346346 }
347347
348- if (!config .disabled && !config .disableEnvironment ) {
349- // Process delayed chunk tasks
350- List <Runnable > tasks = delayedChunkTasks .remove (world );
351- if (tasks != null ) {
352- WorldTickStats stats = worldTickStats .computeIfAbsent (world , w -> new WorldTickStats ());
353- for (Runnable task : tasks ) {
354- long startTime = System .nanoTime ();
355- task .run ();
356- long endTime = System .nanoTime ();
357- stats .chunkTickTimesCurrent .add (endTime - startTime );
358- }
348+ // Process delayed chunk tasks
349+ List <Runnable > tasks = delayedChunkTasks .remove (world );
350+ if (tasks != null ) {
351+ WorldTickStats stats = worldTickStats .computeIfAbsent (world , w -> new WorldTickStats ());
352+ for (Runnable task : tasks ) {
353+ long startTime = System .nanoTime ();
354+ task .run ();
355+ long endTime = System .nanoTime ();
356+ stats .chunkTickTimesCurrent .add (endTime - startTime );
359357 }
360358 }
361359 }
@@ -457,23 +455,22 @@ public static void postEntityTick(ServerWorld world) {
457455 }
458456 }
459457
460- if (!config .disabled && !config .disableEntity ) {
461- // Process delayed entity tasks
462- List <Runnable > tasks = delayedEntityTasks .remove (world );
463- if (tasks != null ) {
464- WorldTickStats stats = worldTickStats .computeIfAbsent (world , w -> new WorldTickStats ());
465- for (Runnable task : tasks ) {
466- long startTime = System .nanoTime ();
467- task .run ();
468- long endTime = System .nanoTime ();
469- stats .entityTickTimesCurrent .add (endTime - startTime );
470- }
458+ // Process delayed entity tasks
459+ List <Runnable > tasks = delayedEntityTasks .remove (world );
460+ if (tasks != null ) {
461+ WorldTickStats stats = worldTickStats .computeIfAbsent (world , w -> new WorldTickStats ());
462+ for (Runnable task : tasks ) {
463+ long startTime = System .nanoTime ();
464+ task .run ();
465+ long endTime = System .nanoTime ();
466+ stats .entityTickTimesCurrent .add (endTime - startTime );
471467 }
472468 }
469+
473470 }
474471
475472 public static void preBlockEntityTick (ServerWorld world ) {
476- if (config .disabled || config .disableTileEntity ) {
473+ if (config .disabled || config .disableBlockEntity ) {
477474 return ;
478475 }
479476 synchronized (threadedChunksRegions ) {
@@ -496,6 +493,11 @@ public static void callBlockEntityTick(BlockEntityTickInvoker tte, World world)
496493 return ;
497494 }
498495
496+ if (config .disabled || config .disableBlockEntity ) {
497+ tte .tick ();
498+ return ;
499+ }
500+
499501 BlockEntity blockEntity = ((WorldChunk .DirectBlockEntityTickInvoker <?>) wrappedInvoker .wrapped ).blockEntity ;
500502 int chunkX = blockEntity .getPos ().getX () >> 4 ;
501503 int chunkZ = blockEntity .getPos ().getZ () >> 4 ;
@@ -562,17 +564,15 @@ public static void postBlockEntityTick(ServerWorld world) {
562564 }
563565 }
564566
565- if (!config .disabled && !config .disableTileEntity ) {
566- // Process delayed block entity tasks
567- List <Runnable > tasks = delayedBlockEntityTasks .remove (world );
568- if (tasks != null ) {
569- WorldTickStats stats = worldTickStats .computeIfAbsent (world , w -> new WorldTickStats ());
570- for (Runnable task : tasks ) {
571- long startTime = System .nanoTime ();
572- task .run ();
573- long endTime = System .nanoTime ();
574- stats .blockEntityTickTimesCurrent .add (endTime - startTime );
575- }
567+ // Process delayed block entity tasks
568+ List <Runnable > tasks = delayedBlockEntityTasks .remove (world );
569+ if (tasks != null ) {
570+ WorldTickStats stats = worldTickStats .computeIfAbsent (world , w -> new WorldTickStats ());
571+ for (Runnable task : tasks ) {
572+ long startTime = System .nanoTime ();
573+ task .run ();
574+ long endTime = System .nanoTime ();
575+ stats .blockEntityTickTimesCurrent .add (endTime - startTime );
576576 }
577577 }
578578
0 commit comments