Skip to content

Commit

Permalink
Add missed warnings (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Dec 17, 2023
1 parent b28d8bd commit 1fcd607
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion patches/server/0124-Disable-moved-wrongly-threshold.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ Subject: [PATCH] Disable moved wrongly threshold


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a6a579a98b5cd814223b3ba32f699573d97a9255..3043871aeb140725006de68b4663c2425511f1dc 100644
index a6a579a98b5cd814223b3ba32f699573d97a9255..6d45aaedbf692dd261f7c2279ec4fb711ee38dc9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -553,7 +553,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper end

- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
+ if (!top.leavesmc.leaves.LeavesConfig.disableMovedWronglyThreshold && d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Leaves - disable can
// CraftBukkit end
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
this.send(new ClientboundMoveVehiclePacket(entity));
@@ -589,7 +589,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false;
Expand All @@ -17,6 +26,15 @@ index a6a579a98b5cd814223b3ba32f699573d97a9255..3043871aeb140725006de68b4663c242
flag2 = true; // Paper - diff on change, this should be moved wrongly
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
}
@@ -1427,7 +1427,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
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.getLogWarning())
+ if (!top.leavesmc.leaves.LeavesConfig.disableMovedWronglyThreshold && event.getLogWarning()) // Leaves - disable can
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
return;
@@ -1497,7 +1497,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag2 = false;
Expand Down

0 comments on commit 1fcd607

Please sign in to comment.