Files
Purpur/patches/server/0266-Send-client-custom-name-of-BE.patch
Ben Kerllenevich cc465d63cd Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@eb0693f Fix EntityDeathEvent cancellation (#9323)
PaperMC/Paper@f8cfdd4 Fix SmithingInventory helper slot methods for 1.20 (#9325)
PaperMC/Paper@de19eb8 fix incorrectly updated move vector checking patch (#9328)
PaperMC/Paper@87dfff4 Implement BossBarViewer on Player (#9332)
PaperMC/Paper@2d09115 Use net.kyori.ansi for console logging (#9313)
PaperMC/Paper@b48e2e3 Fix dev bundle generation
PaperMC/Paper@c287e92 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9301)
PaperMC/Paper@2e363c7 1.20.1 (#9333)
2023-06-13 13:40:15 -04:00

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 2f19f6ac5de454845f5d13a3ebb93af625b2afc8..3431f1a00ae2918b91a6b7a449e613e6e12ff6d4 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
@@ -205,10 +205,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();
}