mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Fix item position desync
This commit is contained in:
@@ -58,6 +58,14 @@ dont-send-useless-entity-packets
|
||||
.. warning::
|
||||
The `dont-send-useless-entity-packets` option is highly experimental! Only enable this if you are feeling brave.
|
||||
|
||||
fix-item-position-desync
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
* **default**: false
|
||||
* **description**: Update item positions according to the rounding the client does
|
||||
|
||||
.. warning::
|
||||
The `fix-item-position-desync` option is highly experimental! Only enable this if you are feeling brave.
|
||||
|
||||
large-ender-chests
|
||||
~~~~~~~~~~~~~~
|
||||
* **default**: true
|
||||
|
||||
46
patches/server/0043-Fix-item-position-desync.patch
Normal file
46
patches/server/0043-Fix-item-position-desync.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
From 1ad2c6ff752f602b69eda84ee39a2b65642d4c09 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 6 Jul 2019 21:12:58 -0500
|
||||
Subject: [PATCH] Fix item position desync
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityTrackerEntry.java | 6 ++++++
|
||||
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
|
||||
2 files changed, 11 insertions(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index 448602057..8885009ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -124,6 +124,12 @@ public class EntityTrackerEntry {
|
||||
++this.o;
|
||||
i = MathHelper.d(this.tracker.yaw * 256.0F / 360.0F);
|
||||
j = MathHelper.d(this.tracker.pitch * 256.0F / 360.0F);
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.fixItemPositionDesync && this.tracker instanceof EntityItem) {
|
||||
+ Vec3D v = PacketPlayOutEntity.a(PacketPlayOutEntity.a(tracker.locX), PacketPlayOutEntity.a(tracker.locY), PacketPlayOutEntity.a(tracker.locZ));
|
||||
+ tracker.setPosition(v.x, v.y, v.z);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
Vec3D vec3d = (new Vec3D(this.tracker.locX, this.tracker.locY, this.tracker.locZ)).d(PacketPlayOutEntity.a(this.xLoc, this.yLoc, this.zLoc));
|
||||
boolean flag1 = vec3d.g() >= 7.62939453125E-6D;
|
||||
Packet<?> packet1 = null;
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index c0ae6accd..c0f02edce 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -146,6 +146,11 @@ public class PurpurConfig {
|
||||
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
}
|
||||
|
||||
+ public static boolean fixItemPositionDesync = false;
|
||||
+ private static void fixItemPositionDesync() {
|
||||
+ fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
+ }
|
||||
+
|
||||
public static boolean requireShiftToMount = true;
|
||||
private static void requireShiftToMount() {
|
||||
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
|
||||
--
|
||||
2.20.1
|
||||
|
||||
Reference in New Issue
Block a user