Files
Purpur/patches/server/0147-Add-MC-4-fix-back.patch
William Blake Galbreath 17368d1aa9 Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
12dec20 Bump paerweight to 1.1.7
e33ed89 Get short commit ref using a more proper method
7d6147d Remove now unneeded patch due to paperweight 1.1.7
e72fa41 Update task dependency for includeMappings so the new task isn't skipped
0ad5526 Trim whitspace off of git hash (oops)

Tuinity Changes:
e878ba9 Update paper
2bd2849 Bring back fix codec spam patch
2021-06-27 00:42:39 -05:00

54 lines
2.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Thu, 7 Jan 2021 07:51:25 -0600
Subject: [PATCH] Add MC-4 fix back
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 685fc8d4ddfab1c6ec04816068fc937038758f8d..103cac9915855858768c80a05e6e6a73f9cb9402 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4029,17 +4029,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
}
- public final void setPosRaw(double x, double y, double z) {
- // Paper start - fix MC-4
- if (this instanceof ItemEntity) {
- if (false && com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) { // Tuinity - revert
- // encode/decode from PacketPlayOutEntity
- x = Mth.lfloor(x * 4096.0D) * (1 / 4096.0D);
- y = Mth.lfloor(y * 4096.0D) * (1 / 4096.0D);
- z = Mth.lfloor(z * 4096.0D) * (1 / 4096.0D);
- }
- }
- // Paper end - fix MC-4
+ public void setPosRaw(double x, double y, double z) { // Purpur - remove final for ItemEntity
// Paper start - never allow AABB to become desynced from position
// hanging has its own special logic
if (!(this instanceof net.minecraft.world.entity.decoration.HangingEntity) && (this.position.x != x || this.position.y != y || this.position.z != z)) {
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 5201e59c7ce9e92790c185279ba69d7fbbfccf90..8845c7b55ac1e6284c4fcd69b395dfb1f5523f90 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -87,6 +87,19 @@ public class ItemEntity extends Entity {
this.bobOffs = entity.bobOffs;
}
+ // Purpur start - fix MC-4
+ @Override
+ public void setPosRaw(double x, double y, double z) {
+ if (com.destroystokyo.paper.PaperConfig.fixEntityPositionDesync) { // Tuinity - revert // Purpur - No.
+ // encode/decode from PacketPlayOutEntity
+ x = Mth.lfloor(x * 4096.0D) * (1 / 4096.0D);
+ y = Mth.lfloor(y * 4096.0D) * (1 / 4096.0D);
+ z = Mth.lfloor(z * 4096.0D) * (1 / 4096.0D);
+ }
+ super.setPosRaw(x, y, z);
+ }
+ // Purpur end - fix MC-4
+
@Override
public boolean occludesVibrations() {
return ItemTags.OCCLUDES_VIBRATION_SIGNALS.contains(this.getItem().getItem());