From 31096e1a48403429b687e63096750e43bc870cf3 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Mon, 7 Jul 2025 18:25:45 +0800 Subject: [PATCH] Add config to enable unsafe waypoint bar --- ...config-to-enable-unsafe-waypoint-bar.patch | 75 +++++++++++++++++++ ...rpur-Barrels-and-enderchests-6-rows.patch} | 0 ...atch => 0012-Stackable-ShulkerBoxes.patch} | 0 ...tch => 0013-Spawn-invulnerable-time.patch} | 0 ...014-Old-Explosion-Damage-Calculator.patch} | 0 ...> 0015-Old-replaceable-by-mushrooms.patch} | 0 ...ch => 0016-Old-zombie-reinforcement.patch} | 0 ...-support.patch => 0017-I18n-support.patch} | 0 .../modules/experiment/WaypointConfig.java | 22 ++++++ 9 files changed, 97 insertions(+) create mode 100644 lophine-server/minecraft-patches/features/0010-Add-config-to-enable-unsafe-waypoint-bar.patch rename lophine-server/minecraft-patches/features/{0010-Purpur-Barrels-and-enderchests-6-rows.patch => 0011-Purpur-Barrels-and-enderchests-6-rows.patch} (100%) rename lophine-server/minecraft-patches/features/{0011-Stackable-ShulkerBoxes.patch => 0012-Stackable-ShulkerBoxes.patch} (100%) rename lophine-server/minecraft-patches/features/{0012-Spawn-invulnerable-time.patch => 0013-Spawn-invulnerable-time.patch} (100%) rename lophine-server/minecraft-patches/features/{0013-Old-Explosion-Damage-Calculator.patch => 0014-Old-Explosion-Damage-Calculator.patch} (100%) rename lophine-server/minecraft-patches/features/{0014-Old-replaceable-by-mushrooms.patch => 0015-Old-replaceable-by-mushrooms.patch} (100%) rename lophine-server/minecraft-patches/features/{0015-Old-zombie-reinforcement.patch => 0016-Old-zombie-reinforcement.patch} (100%) rename lophine-server/minecraft-patches/features/{0016-I18n-support.patch => 0017-I18n-support.patch} (100%) create mode 100644 lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/WaypointConfig.java diff --git a/lophine-server/minecraft-patches/features/0010-Add-config-to-enable-unsafe-waypoint-bar.patch b/lophine-server/minecraft-patches/features/0010-Add-config-to-enable-unsafe-waypoint-bar.patch new file mode 100644 index 0000000..c736752 --- /dev/null +++ b/lophine-server/minecraft-patches/features/0010-Add-config-to-enable-unsafe-waypoint-bar.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Helvetica Volubi +Date: Mon, 7 Jul 2025 18:19:00 +0800 +Subject: [PATCH] Add config to enable unsafe waypoint bar + + +diff --git a/net/minecraft/server/waypoints/ServerWaypointManager.java b/net/minecraft/server/waypoints/ServerWaypointManager.java +index 0f8cacbb8fe55a60e2f0c98bf36c005b29f41a4b..36e9b027ce5213f8914728293633e78e9905c1b2 100644 +--- a/net/minecraft/server/waypoints/ServerWaypointManager.java ++++ b/net/minecraft/server/waypoints/ServerWaypointManager.java +@@ -22,7 +22,14 @@ public class ServerWaypointManager implements WaypointManager map = this.connections.row(player); ++ SetView set = Sets.difference(this.waypoints, map.keySet()); ++ ++ for (Entry entry : ImmutableSet.copyOf(map.entrySet())) { ++ this.updateConnection(player, entry.getKey(), entry.getValue()); ++ } ++ ++ for (WaypointTransmitter waypointTransmitter : set) { ++ this.createConnection(player, waypointTransmitter); ++ } ++ // Lophine end - unsafe waypoint bar + } + + public void removePlayer(ServerPlayer player) { + // Folia - region threading ++ // Lophine start - unsafe waypoint bar ++ if (!fun.bm.lophine.config.modules.experiment.WaypointConfig.forceEnableWaypointUnsafe) return; ++ this.connections.row(player).values().removeIf(connection -> { ++ connection.disconnect(); ++ return true; ++ }); ++ this.untrackWaypoint((WaypointTransmitter)player); ++ this.players.remove(player); ++ // Lophine end - unsafe waypoint bar + } + + public void breakAllConnections() { diff --git a/lophine-server/minecraft-patches/features/0010-Purpur-Barrels-and-enderchests-6-rows.patch b/lophine-server/minecraft-patches/features/0011-Purpur-Barrels-and-enderchests-6-rows.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0010-Purpur-Barrels-and-enderchests-6-rows.patch rename to lophine-server/minecraft-patches/features/0011-Purpur-Barrels-and-enderchests-6-rows.patch diff --git a/lophine-server/minecraft-patches/features/0011-Stackable-ShulkerBoxes.patch b/lophine-server/minecraft-patches/features/0012-Stackable-ShulkerBoxes.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0011-Stackable-ShulkerBoxes.patch rename to lophine-server/minecraft-patches/features/0012-Stackable-ShulkerBoxes.patch diff --git a/lophine-server/minecraft-patches/features/0012-Spawn-invulnerable-time.patch b/lophine-server/minecraft-patches/features/0013-Spawn-invulnerable-time.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0012-Spawn-invulnerable-time.patch rename to lophine-server/minecraft-patches/features/0013-Spawn-invulnerable-time.patch diff --git a/lophine-server/minecraft-patches/features/0013-Old-Explosion-Damage-Calculator.patch b/lophine-server/minecraft-patches/features/0014-Old-Explosion-Damage-Calculator.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0013-Old-Explosion-Damage-Calculator.patch rename to lophine-server/minecraft-patches/features/0014-Old-Explosion-Damage-Calculator.patch diff --git a/lophine-server/minecraft-patches/features/0014-Old-replaceable-by-mushrooms.patch b/lophine-server/minecraft-patches/features/0015-Old-replaceable-by-mushrooms.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0014-Old-replaceable-by-mushrooms.patch rename to lophine-server/minecraft-patches/features/0015-Old-replaceable-by-mushrooms.patch diff --git a/lophine-server/minecraft-patches/features/0015-Old-zombie-reinforcement.patch b/lophine-server/minecraft-patches/features/0016-Old-zombie-reinforcement.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0015-Old-zombie-reinforcement.patch rename to lophine-server/minecraft-patches/features/0016-Old-zombie-reinforcement.patch diff --git a/lophine-server/minecraft-patches/features/0016-I18n-support.patch b/lophine-server/minecraft-patches/features/0017-I18n-support.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0016-I18n-support.patch rename to lophine-server/minecraft-patches/features/0017-I18n-support.patch diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/WaypointConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/WaypointConfig.java new file mode 100644 index 0000000..5779dad --- /dev/null +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/experiment/WaypointConfig.java @@ -0,0 +1,22 @@ +package fun.bm.lophine.config.modules.experiment; + +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; +import me.earthme.luminol.config.flags.ConfigInfo; + +public class WaypointConfig implements IConfigModule { + @ConfigInfo(baseName = "enable-waypoint", comments = + """ + Enable waypoint bar unsafe""") + public static boolean forceEnableWaypointUnsafe = false; + + @Override + public EnumConfigCategory getCategory() { + return EnumConfigCategory.EXPERIMENT; + } + + @Override + public String getBaseName() { + return "waypoint bar"; + } +}