9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2025-12-21 15:59:33 +00:00
Files
LeavesMC/patches/server/0048-InstantBlockUpdater-Reintroduced.patch
2022-12-14 17:13:20 +08:00

55 lines
2.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Tue, 29 Nov 2022 14:54:56 +0800
Subject: [PATCH] InstantBlockUpdater Reintroduced
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index dda31b5eea92ce3de9de0e4054ee9c7f6df631e4..dd3868045923eed8c6eaf87a57d9bf7dcd466433 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -72,6 +72,7 @@ import net.minecraft.world.level.lighting.LevelLightEngine;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.redstone.CollectingNeighborUpdater;
+import net.minecraft.world.level.redstone.InstantNeighborUpdater;
import net.minecraft.world.level.redstone.NeighborUpdater;
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
import net.minecraft.world.level.storage.LevelData;
@@ -317,7 +318,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.thread = Thread.currentThread();
this.biomeManager = new BiomeManager(this, i);
this.isDebug = flag1;
- this.neighborUpdater = new CollectingNeighborUpdater(this, j);
+ // Leaves start - instantBlockUpdaterReintroduced
+ if (top.leavesmc.leaves.LeavesConfig.instantBlockUpdaterReintroduced) {
+ this.neighborUpdater = new InstantNeighborUpdater(this);
+ } else {
+ this.neighborUpdater = new CollectingNeighborUpdater(this, j);
+ }
+ // Leaves end - instantBlockUpdaterReintroduced
// CraftBukkit start
this.getWorldBorder().world = (ServerLevel) this;
// From PlayerList.setPlayerFileData
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
index 25a86927e6616a9b2105c06d789bc74c7efa6e60..3dc43c3e292724d199b973273006350a594e754e 100644
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -404,6 +404,15 @@ public final class LeavesConfig {
bborProtocol = getBoolean("settings.protocol.bbor-protocol", bborProtocol);
}
+ public static boolean instantBlockUpdaterReintroduced = false;
+ private static boolean instantBlockUpdaterReintroducedLock = false;
+ private static void instantBlockUpdaterReintroduced() {
+ if (!instantBlockUpdaterReintroducedLock) {
+ instantBlockUpdaterReintroduced = getBoolean("settings.modify.instant-block-updater-reintroduced", instantBlockUpdaterReintroduced);
+ instantBlockUpdaterReintroducedLock = true;
+ }
+ }
+
public static final class WorldConfig {
public final String worldName;