From a5e56ff2ca508a694fe329f761b6d3418a57b0b5 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Sun, 3 Aug 2025 14:29:51 +0800 Subject: [PATCH] feat: add a config to allow to disable some check for operator --- ...-config-to-disable-end-crystal-check.patch | 4 +- ...rarily-fix-endermite-spawn-position.patch} | 0 ...patch => 0013-Leaves-Vanilla-hopper.patch} | 0 ...patch => 0014-Paper-Fix-quick-craft.patch} | 0 ...rpur-Barrels-and-enderchests-6-rows.patch} | 0 ...tch => 0016-Spawn-invulnerable-time.patch} | 0 ...017-Old-Explosion-Damage-Calculator.patch} | 0 ...> 0018-Old-replaceable-by-mushrooms.patch} | 0 ...ch => 0019-Old-zombie-reinforcement.patch} | 0 ...-support.patch => 0020-I18n-support.patch} | 0 ...021-Disable-some-check-for-operators.patch | 55 +++++++++++++++++++ .../DisableEndCrystalCheckConfig.java | 6 +- .../modules/misc/DisableCheckConfig.java | 25 +++++++++ .../modules/optimizations/NetworkConfig.java | 2 +- 14 files changed, 87 insertions(+), 5 deletions(-) rename lophine-server/minecraft-patches/features/{0020-Leaves-Temporarily-fix-endermite-spawn-position.patch => 0012-Leaves-Temporarily-fix-endermite-spawn-position.patch} (100%) rename lophine-server/minecraft-patches/features/{0012-Leaves-Vanilla-hopper.patch => 0013-Leaves-Vanilla-hopper.patch} (100%) rename lophine-server/minecraft-patches/features/{0013-Paper-Fix-quick-craft.patch => 0014-Paper-Fix-quick-craft.patch} (100%) rename lophine-server/minecraft-patches/features/{0014-Purpur-Barrels-and-enderchests-6-rows.patch => 0015-Purpur-Barrels-and-enderchests-6-rows.patch} (100%) rename lophine-server/minecraft-patches/features/{0015-Spawn-invulnerable-time.patch => 0016-Spawn-invulnerable-time.patch} (100%) rename lophine-server/minecraft-patches/features/{0016-Old-Explosion-Damage-Calculator.patch => 0017-Old-Explosion-Damage-Calculator.patch} (100%) rename lophine-server/minecraft-patches/features/{0017-Old-replaceable-by-mushrooms.patch => 0018-Old-replaceable-by-mushrooms.patch} (100%) rename lophine-server/minecraft-patches/features/{0018-Old-zombie-reinforcement.patch => 0019-Old-zombie-reinforcement.patch} (100%) rename lophine-server/minecraft-patches/features/{0019-I18n-support.patch => 0020-I18n-support.patch} (100%) create mode 100644 lophine-server/minecraft-patches/features/0021-Disable-some-check-for-operators.patch rename lophine-server/src/main/java/fun/bm/lophine/config/modules/{misc => fixes}/DisableEndCrystalCheckConfig.java (72%) create mode 100644 lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableCheckConfig.java diff --git a/lophine-server/minecraft-patches/features/0001-Add-config-to-disable-end-crystal-check.patch b/lophine-server/minecraft-patches/features/0001-Add-config-to-disable-end-crystal-check.patch index 93753fe..ba75e06 100644 --- a/lophine-server/minecraft-patches/features/0001-Add-config-to-disable-end-crystal-check.patch +++ b/lophine-server/minecraft-patches/features/0001-Add-config-to-disable-end-crystal-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add config to disable end crystal check diff --git a/net/minecraft/world/level/dimension/end/EndDragonFight.java b/net/minecraft/world/level/dimension/end/EndDragonFight.java -index 4fa8371c212dcc02b8cf5fd267b736e1cf3f50c1..4fb9244172b74c3c5fed984d5d3b968f76dd12be 100644 +index 4fa8371c212dcc02b8cf5fd267b736e1cf3f50c1..3f1520bdd5ef708824712ea62974fedb35067f23 100644 --- a/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java @@ -547,6 +547,8 @@ public class EndDragonFight { @@ -13,7 +13,7 @@ index 4fa8371c212dcc02b8cf5fd267b736e1cf3f50c1..4fb9244172b74c3c5fed984d5d3b968f blockPos = this.portalLocation; } + // Luminol start - Disable end crystal check -+ if (!fun.bm.lophine.config.modules.misc.DisableEndCrystalCheckConfig.disableCheck) { ++ if (!fun.bm.lophine.config.modules.fixes.DisableEndCrystalCheckConfig.disableCheck) { // Paper start - Perf: Do crystal-portal proximity check before entity lookup if (placedEndCrystalPos != null) { // The end crystal must be 0 or 1 higher than the portal origin diff --git a/lophine-server/minecraft-patches/features/0020-Leaves-Temporarily-fix-endermite-spawn-position.patch b/lophine-server/minecraft-patches/features/0012-Leaves-Temporarily-fix-endermite-spawn-position.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0020-Leaves-Temporarily-fix-endermite-spawn-position.patch rename to lophine-server/minecraft-patches/features/0012-Leaves-Temporarily-fix-endermite-spawn-position.patch diff --git a/lophine-server/minecraft-patches/features/0012-Leaves-Vanilla-hopper.patch b/lophine-server/minecraft-patches/features/0013-Leaves-Vanilla-hopper.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0012-Leaves-Vanilla-hopper.patch rename to lophine-server/minecraft-patches/features/0013-Leaves-Vanilla-hopper.patch diff --git a/lophine-server/minecraft-patches/features/0013-Paper-Fix-quick-craft.patch b/lophine-server/minecraft-patches/features/0014-Paper-Fix-quick-craft.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0013-Paper-Fix-quick-craft.patch rename to lophine-server/minecraft-patches/features/0014-Paper-Fix-quick-craft.patch diff --git a/lophine-server/minecraft-patches/features/0014-Purpur-Barrels-and-enderchests-6-rows.patch b/lophine-server/minecraft-patches/features/0015-Purpur-Barrels-and-enderchests-6-rows.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0014-Purpur-Barrels-and-enderchests-6-rows.patch rename to lophine-server/minecraft-patches/features/0015-Purpur-Barrels-and-enderchests-6-rows.patch diff --git a/lophine-server/minecraft-patches/features/0015-Spawn-invulnerable-time.patch b/lophine-server/minecraft-patches/features/0016-Spawn-invulnerable-time.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0015-Spawn-invulnerable-time.patch rename to lophine-server/minecraft-patches/features/0016-Spawn-invulnerable-time.patch diff --git a/lophine-server/minecraft-patches/features/0016-Old-Explosion-Damage-Calculator.patch b/lophine-server/minecraft-patches/features/0017-Old-Explosion-Damage-Calculator.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0016-Old-Explosion-Damage-Calculator.patch rename to lophine-server/minecraft-patches/features/0017-Old-Explosion-Damage-Calculator.patch diff --git a/lophine-server/minecraft-patches/features/0017-Old-replaceable-by-mushrooms.patch b/lophine-server/minecraft-patches/features/0018-Old-replaceable-by-mushrooms.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0017-Old-replaceable-by-mushrooms.patch rename to lophine-server/minecraft-patches/features/0018-Old-replaceable-by-mushrooms.patch diff --git a/lophine-server/minecraft-patches/features/0018-Old-zombie-reinforcement.patch b/lophine-server/minecraft-patches/features/0019-Old-zombie-reinforcement.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0018-Old-zombie-reinforcement.patch rename to lophine-server/minecraft-patches/features/0019-Old-zombie-reinforcement.patch diff --git a/lophine-server/minecraft-patches/features/0019-I18n-support.patch b/lophine-server/minecraft-patches/features/0020-I18n-support.patch similarity index 100% rename from lophine-server/minecraft-patches/features/0019-I18n-support.patch rename to lophine-server/minecraft-patches/features/0020-I18n-support.patch diff --git a/lophine-server/minecraft-patches/features/0021-Disable-some-check-for-operators.patch b/lophine-server/minecraft-patches/features/0021-Disable-some-check-for-operators.patch new file mode 100644 index 0000000..2c7838d --- /dev/null +++ b/lophine-server/minecraft-patches/features/0021-Disable-some-check-for-operators.patch @@ -0,0 +1,55 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Helvetica Volubi +Date: Sun, 3 Aug 2025 14:26:37 +0800 +Subject: [PATCH] Disable some check for operators + + +diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index a684f5edf420d9655046de872c54e0c1a89103cf..105675bef05408bd5baf1b6129c0392065bbe79d 100644 +--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -367,7 +367,7 @@ public class ServerGamePacketListenerImpl + this.tickCount++; + this.knownMovePacketCount = this.receivedMovePacketCount; + if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) { +- if (++this.aboveGroundTickCount > this.getMaximumFlyingTicks(this.player)) { ++ if (++this.aboveGroundTickCount > this.getMaximumFlyingTicks(this.player) && !(fun.bm.lophine.config.modules.misc.DisableCheckConfig.disableOpFlyCheck && this.player.hasPermissions(2))) { // Lophine - disable fly check for operator + // LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); // Paper - Logging moved to net.minecraft.server.network.ServerCommonPacketListenerImpl.disconnect() + this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingPlayer, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_PLAYER); // Paper - use configurable kick message & kick event cause + return; +@@ -386,7 +386,7 @@ public class ServerGamePacketListenerImpl + this.vehicleLastGoodY = this.lastVehicle.getY(); + this.vehicleLastGoodZ = this.lastVehicle.getZ(); + if (this.clientVehicleIsFloating && this.lastVehicle.getControllingPassenger() == this.player) { +- if (++this.aboveGroundVehicleTickCount > this.getMaximumFlyingTicks(this.lastVehicle)) { ++ if (++this.aboveGroundVehicleTickCount > this.getMaximumFlyingTicks(this.lastVehicle) && !(fun.bm.lophine.config.modules.misc.DisableCheckConfig.disableOpFlyCheck && this.player.hasPermissions(2))) { // Lophine - disable fly check for operator + // LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); // Paper - Logging moved to net.minecraft.server.network.ServerCommonPacketListenerImpl.disconnect() + this.disconnect(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.flyingVehicle, org.bukkit.event.player.PlayerKickEvent.Cause.FLYING_VEHICLE); // Paper - use configurable kick message & kick event cause + return; +@@ -644,7 +644,7 @@ public class ServerGamePacketListenerImpl + d5 = d2 - rootVehicle.getZ(); + d7 = d3 * d3 + d4 * d4 + d5 * d5; + boolean flag1 = false; +- if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot ++ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !(fun.bm.lophine.config.modules.misc.DisableCheckConfig.disableOpMoveCheck && this.player.hasPermissions(2))) { // Spigot // Lophine - disable move check for operator + flag1 = true; // Paper - diff on change, this should be moved wrongly + LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7)); + } +@@ -1540,7 +1540,7 @@ public class ServerGamePacketListenerImpl + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY, + toX, toY, toZ, toYaw, toPitch, true); +- if (!event.isAllowed()) { ++ if (!event.isAllowed() && !(fun.bm.lophine.config.modules.misc.DisableCheckConfig.disableOpMoveCheck && this.player.hasPermissions(2))) { // Lophine - disable move check for operator + if (event.getLogWarning()) { + LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName().getString(), d3, d4, d5); + } +@@ -1618,7 +1618,7 @@ public class ServerGamePacketListenerImpl + // Paper start - Add fail move event + io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY, + toX, toY, toZ, toYaw, toPitch, true); +- if (!event.isAllowed()) { ++ if (!event.isAllowed() && !(fun.bm.lophine.config.modules.misc.DisableCheckConfig.disableOpMoveCheck && this.player.hasPermissions(2))) { // Lophine - disable move check for operator + movedWrongly = true; + if (event.getLogWarning()) + // Paper end diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableEndCrystalCheckConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/fixes/DisableEndCrystalCheckConfig.java similarity index 72% rename from lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableEndCrystalCheckConfig.java rename to lophine-server/src/main/java/fun/bm/lophine/config/modules/fixes/DisableEndCrystalCheckConfig.java index 7b71ab7..0116a9f 100644 --- a/lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableEndCrystalCheckConfig.java +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/fixes/DisableEndCrystalCheckConfig.java @@ -1,10 +1,12 @@ -package fun.bm.lophine.config.modules.misc; +package fun.bm.lophine.config.modules.fixes; import me.earthme.luminol.config.EnumConfigCategory; import me.earthme.luminol.config.IConfigModule; import me.earthme.luminol.config.flags.ConfigInfo; +import me.earthme.luminol.config.flags.TransformedConfig; public class DisableEndCrystalCheckConfig implements IConfigModule { + @TransformedConfig(name = "disable_end_crystal_check", category = {"misc", "end_crystal"}) @ConfigInfo(baseName = "disable_end_crystal_check", comments = """ Disable paper's End Crystal position check. @@ -13,7 +15,7 @@ public class DisableEndCrystalCheckConfig implements IConfigModule { @Override public EnumConfigCategory getCategory() { - return EnumConfigCategory.MISC; + return EnumConfigCategory.FIXES; } @Override diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableCheckConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableCheckConfig.java new file mode 100644 index 0000000..50e9c14 --- /dev/null +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/misc/DisableCheckConfig.java @@ -0,0 +1,25 @@ +package fun.bm.lophine.config.modules.misc; + +import me.earthme.luminol.config.EnumConfigCategory; +import me.earthme.luminol.config.IConfigModule; +import me.earthme.luminol.config.flags.ConfigInfo; + +public class DisableCheckConfig implements IConfigModule { + @ConfigInfo(baseName = "disable-op-move-check", comments = """ + Disable the check for the operator's move check""") + public static boolean disableOpMoveCheck = false; + + @ConfigInfo(baseName = "disable-op-fly-check", comments = """ + Disable the check for the operator's fly check""") + public static boolean disableOpFlyCheck = false; + + @Override + public EnumConfigCategory getCategory() { + return EnumConfigCategory.MISC; + } + + @Override + public String getBaseName() { + return "disable-check"; + } +} diff --git a/lophine-server/src/main/java/fun/bm/lophine/config/modules/optimizations/NetworkConfig.java b/lophine-server/src/main/java/fun/bm/lophine/config/modules/optimizations/NetworkConfig.java index 2965a5e..f217c77 100644 --- a/lophine-server/src/main/java/fun/bm/lophine/config/modules/optimizations/NetworkConfig.java +++ b/lophine-server/src/main/java/fun/bm/lophine/config/modules/optimizations/NetworkConfig.java @@ -7,7 +7,7 @@ import me.earthme.luminol.config.flags.ConfigInfo; public class NetworkConfig implements IConfigModule { @ConfigInfo(baseName = "unlimit-packet", comments = """ Disable packet limit""") - public static boolean disablePacketLimit = true; + public static boolean disablePacketLimit = false; @Override public EnumConfigCategory getCategory() {