mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-27 02:49:10 +00:00
InstantBlockUpdater Reintroduced
This commit is contained in:
53
patches/server/0048-InstantBlockUpdater-Reintroduced.patch
Normal file
53
patches/server/0048-InstantBlockUpdater-Reintroduced.patch
Normal file
@@ -0,0 +1,53 @@
|
||||
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
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 1070d33c3df23f0ed6073eee2e67680e831e53fc..53a5507692c89dd3584e9d356b802cd03364bf91 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -70,6 +70,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;
|
||||
@@ -318,7 +319,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 3e5855c5eef8038c5af69ef447fe0c2b90c33acb..5d1a6ed87f4139dce18343e4a0d70a8922cab308 100644
|
||||
--- a/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
|
||||
@@ -403,6 +403,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;
|
||||
Reference in New Issue
Block a user