4df4d07ae9
* do not release & push repo before finished * langs update * updateSuppression config moved up * redirect tick command option to carpet config system * optimizedDragonRespawn * diff in files * counter rules transformed * oops! * some fakeplayer options moved up * simplify * creative no clip moved * pre remove core module * pre update luminol to further fix a bug that config not saved to real file * fix up transform * fix up transform * fix up * fix up some problem in PR * redirect forgotten moved config * fix bugs in PR * refix * switch for final merge
61 lines
3.7 KiB
Diff
61 lines
3.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
|
Date: Mon, 17 Nov 2025 18:41:08 +0800
|
|
Subject: [PATCH] Instant Block Updater
|
|
|
|
|
|
diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
|
index 64d407c5a6140a7e5dc47a8e304b4c00602e2bdd..1a426e1aa456a8ea432f62483c3be5c328b97953 100644
|
|
--- a/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
|
+++ b/io/papermc/paper/threadedregions/RegionizedWorldData.java
|
|
@@ -506,7 +506,7 @@ public final class RegionizedWorldData {
|
|
public long lastMidTickExecuteFailure;
|
|
// From Level
|
|
public boolean populating;
|
|
- public final CollectingNeighborUpdater neighborUpdater;
|
|
+ public final net.minecraft.world.level.redstone.NeighborUpdater neighborUpdater;
|
|
public boolean captureBlockStates = false;
|
|
public boolean captureTreeGeneration = false;
|
|
public final Map<BlockPos, CraftBlockState> capturedBlockStates = new java.util.LinkedHashMap<>(); // Paper
|
|
@@ -567,7 +567,9 @@ public final class RegionizedWorldData {
|
|
this.world = world;
|
|
this.blockLevelTicks = new LevelTicks<>(world::isPositionTickingWithEntitiesLoaded, world, true);
|
|
this.fluidLevelTicks = new LevelTicks<>(world::isPositionTickingWithEntitiesLoaded, world, false);
|
|
- this.neighborUpdater = new CollectingNeighborUpdater(world, world.neighbourUpdateMax);
|
|
+ this.neighborUpdater = fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.instantBlockUpdaterReintroduced
|
|
+ ? new net.minecraft.world.level.redstone.InstantNeighborUpdater(world)
|
|
+ : new CollectingNeighborUpdater(world, world.neighbourUpdateMax);
|
|
this.nearbyPlayers = new NearbyPlayers(world);
|
|
this.wireHandler = new alternate.current.wire.WireHandler(world);
|
|
this.turbo = new io.papermc.paper.redstone.RedstoneWireTurbo((RedStoneWireBlock)Blocks.REDSTONE_WIRE);
|
|
@@ -896,4 +898,4 @@ public final class RegionizedWorldData {
|
|
public int getChunkCount() {
|
|
return this.chunks.size();
|
|
}
|
|
-}
|
|
\ No newline at end of file
|
|
+}
|
|
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
|
index 3496696c6b023e7df95027917b3391557dddd8d0..d8718805a965db11dfce8ed7f5ea65a638cc4510 100644
|
|
--- a/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/net/minecraft/server/level/ServerLevel.java
|
|
@@ -999,11 +999,13 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet
|
|
// Paper - rewrite chunk system
|
|
profiler.pop();
|
|
profiler.push("debugSynchronizers");
|
|
- if (this.debugSynchronizers.hasAnySubscriberFor(DebugSubscriptions.NEIGHBOR_UPDATES)) {
|
|
- regionizedWorldData.neighborUpdater // Folia - region threading
|
|
- .setDebugListener(blockPos -> this.debugSynchronizers.broadcastEventToTracking(blockPos, DebugSubscriptions.NEIGHBOR_UPDATES, blockPos));
|
|
- } else {
|
|
- regionizedWorldData.neighborUpdater.setDebugListener(null); // Folia - region threading
|
|
+ if (regionizedWorldData.neighborUpdater instanceof net.minecraft.world.level.redstone.CollectingNeighborUpdater neighborUpdater) {
|
|
+ if (this.debugSynchronizers.hasAnySubscriberFor(DebugSubscriptions.NEIGHBOR_UPDATES)) {
|
|
+ neighborUpdater // Folia - region threading
|
|
+ .setDebugListener(blockPos -> this.debugSynchronizers.broadcastEventToTracking(blockPos, DebugSubscriptions.NEIGHBOR_UPDATES, blockPos));
|
|
+ } else {
|
|
+ neighborUpdater.setDebugListener(null); // Folia - region threading
|
|
+ }
|
|
}
|
|
|
|
this.debugSynchronizers.tick(this.server.debugSubscribers());
|