feat: add a config to allow to disable some check for operator
This commit is contained in:
+2
-2
@@ -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
|
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
|
--- a/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
+++ b/net/minecraft/world/level/dimension/end/EndDragonFight.java
|
||||||
@@ -547,6 +547,8 @@ public class EndDragonFight {
|
@@ -547,6 +547,8 @@ public class EndDragonFight {
|
||||||
@@ -13,7 +13,7 @@ index 4fa8371c212dcc02b8cf5fd267b736e1cf3f50c1..4fb9244172b74c3c5fed984d5d3b968f
|
|||||||
blockPos = this.portalLocation;
|
blockPos = this.portalLocation;
|
||||||
}
|
}
|
||||||
+ // Luminol start - Disable end crystal check
|
+ // 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
|
// Paper start - Perf: Do crystal-portal proximity check before entity lookup
|
||||||
if (placedEndCrystalPos != null) {
|
if (placedEndCrystalPos != null) {
|
||||||
// The end crystal must be 0 or 1 higher than the portal origin
|
// The end crystal must be 0 or 1 higher than the portal origin
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||||
|
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
|
||||||
+4
-2
@@ -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.EnumConfigCategory;
|
||||||
import me.earthme.luminol.config.IConfigModule;
|
import me.earthme.luminol.config.IConfigModule;
|
||||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||||
|
import me.earthme.luminol.config.flags.TransformedConfig;
|
||||||
|
|
||||||
public class DisableEndCrystalCheckConfig implements IConfigModule {
|
public class DisableEndCrystalCheckConfig implements IConfigModule {
|
||||||
|
@TransformedConfig(name = "disable_end_crystal_check", category = {"misc", "end_crystal"})
|
||||||
@ConfigInfo(baseName = "disable_end_crystal_check", comments =
|
@ConfigInfo(baseName = "disable_end_crystal_check", comments =
|
||||||
"""
|
"""
|
||||||
Disable paper's End Crystal position check.
|
Disable paper's End Crystal position check.
|
||||||
@@ -13,7 +15,7 @@ public class DisableEndCrystalCheckConfig implements IConfigModule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumConfigCategory getCategory() {
|
public EnumConfigCategory getCategory() {
|
||||||
return EnumConfigCategory.MISC;
|
return EnumConfigCategory.FIXES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
+25
@@ -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";
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -7,7 +7,7 @@ import me.earthme.luminol.config.flags.ConfigInfo;
|
|||||||
public class NetworkConfig implements IConfigModule {
|
public class NetworkConfig implements IConfigModule {
|
||||||
@ConfigInfo(baseName = "unlimit-packet", comments = """
|
@ConfigInfo(baseName = "unlimit-packet", comments = """
|
||||||
Disable packet limit""")
|
Disable packet limit""")
|
||||||
public static boolean disablePacketLimit = true;
|
public static boolean disablePacketLimit = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumConfigCategory getCategory() {
|
public EnumConfigCategory getCategory() {
|
||||||
|
|||||||
Reference in New Issue
Block a user