mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@2040c1e Player Flying Fall Damage API (#5357) PaperMC/Paper@fa42c68 Expose pre-collision moving velocity to VehicleBlockCollisionEvent (#8457) PaperMC/Paper@90750a6 Rework filtering spawn egg and tile entity nbt config (#6613)
36 lines
1.5 KiB
Diff
36 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Ben Kerllenevich <ben@omega24.dev>
|
|
Date: Wed, 13 Jul 2022 16:27:43 -0400
|
|
Subject: [PATCH] Send client custom name of BE
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
index 59d616137088af46d4494171fe96ba0129082496..efc1bdcaf141a2c2152173439d707f50feaaf91a 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
|
@@ -206,10 +206,24 @@ public abstract class BlockEntity {
|
|
|
|
@Nullable
|
|
public Packet<ClientGamePacketListener> getUpdatePacket() {
|
|
+ // Purpur start
|
|
+ if (this instanceof net.minecraft.world.Nameable nameable && nameable.hasCustomName()) {
|
|
+ CompoundTag nbt = this.saveWithoutMetadata();
|
|
+ nbt.remove("Items");
|
|
+ return net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket.create(this, $ -> nbt);
|
|
+ }
|
|
+ // Purpur end
|
|
return null;
|
|
}
|
|
|
|
public CompoundTag getUpdateTag() {
|
|
+ // Purpur start
|
|
+ if (this instanceof net.minecraft.world.Nameable nameable && nameable.hasCustomName()) {
|
|
+ CompoundTag nbt = this.saveWithoutMetadata();
|
|
+ nbt.remove("Items");
|
|
+ return nbt;
|
|
+ }
|
|
+ // Purpur end
|
|
return new CompoundTag();
|
|
}
|
|
|