diff options
author | Glare <[email protected]> | 2021-12-09 20:02:41 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-09 18:02:41 -0800 |
commit | dce79f333c1f3f60335163d8fe1050d424722a92 (patch) | |
tree | 12559c6101a93eaea0a2fd7147151caaf5d322e2 /patches/server/0771-Send-full-pos-packets-for-hard-colliding-entities.patch | |
parent | 4e355c488dc72e3c6701c69d2e4d6099449671b4 (diff) | |
download | Paper-dce79f333c1f3f60335163d8fe1050d424722a92.tar.gz Paper-dce79f333c1f3f60335163d8fe1050d424722a92.zip |
Update Log4J (#7069)
Diffstat (limited to 'patches/server/0771-Send-full-pos-packets-for-hard-colliding-entities.patch')
-rw-r--r-- | patches/server/0771-Send-full-pos-packets-for-hard-colliding-entities.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/patches/server/0771-Send-full-pos-packets-for-hard-colliding-entities.patch b/patches/server/0771-Send-full-pos-packets-for-hard-colliding-entities.patch new file mode 100644 index 0000000000..af1611e279 --- /dev/null +++ b/patches/server/0771-Send-full-pos-packets-for-hard-colliding-entities.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf <[email protected]> +Date: Tue, 16 Feb 2021 00:16:56 -0800 +Subject: [PATCH] Send full pos packets for hard colliding entities + +Prevent collision problems due to desync (i.e boats) + +Configurable under +`send-full-pos-for-hard-colliding-entities` + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index f34ae86812b13a96b509724591a75c1aacd5e918..eaa1d5491ef3f5caf156d16fa7544741e53c6bab 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -622,4 +622,10 @@ public class PaperConfig { + private static void lagCompensateBlockBreaking() { + lagCompensateBlockBreaking = getBoolean("settings.lag-compensate-block-breaking", true); + } ++ ++ public static boolean sendFullPosForHardCollidingEntities; ++ ++ private static void sendFullPosForHardCollidingEntities() { ++ sendFullPosForHardCollidingEntities = getBoolean("settings.send-full-pos-for-hard-colliding-entities", true); ++ } + } +diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java +index 94704a258ce7183aeb0ccec0b9106e40efd08821..703ac671b19636859648f16a5431b2700791e7d5 100644 +--- a/src/main/java/net/minecraft/server/level/ServerEntity.java ++++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +@@ -172,7 +172,7 @@ public class ServerEntity { + // Paper end - remove allocation of Vec3D here + boolean flag4 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L; + +- if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround()) { ++ if (!flag4 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.isOnGround() && !(com.destroystokyo.paper.PaperConfig.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync + if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) { + if (flag2) { + packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.isOnGround()); |