From b2cea780066aadfc62fefef9f68759e0b22fbf39 Mon Sep 17 00:00:00 2001 From: OneLemonyBoi <50998649+OneLemonyBoi@users.noreply.github.com> Date: Mon, 4 Oct 2021 12:40:58 -0700 Subject: [PATCH] Prevent Block/Entity data side leak on integrated servers by copying custom data before writing. #8111 --- patches/minecraft/net/minecraft/world/entity/Entity.java.patch | 2 +- .../minecraft/world/level/block/entity/BlockEntity.java.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch index 6ff5ae0807..56ff2730a7 100644 --- a/patches/minecraft/net/minecraft/world/entity/Entity.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/Entity.java.patch @@ -151,7 +151,7 @@ + CompoundTag caps = serializeCaps(); + if (caps != null) p_20241_.m_128365_("ForgeCaps", caps); -+ if (persistentData != null) p_20241_.m_128365_("ForgeData", persistentData); ++ if (persistentData != null) p_20241_.m_128365_("ForgeData", persistentData.m_6426_()); + this.m_7380_(p_20241_); if (this.m_20160_()) { diff --git a/patches/minecraft/net/minecraft/world/level/block/entity/BlockEntity.java.patch b/patches/minecraft/net/minecraft/world/level/block/entity/BlockEntity.java.patch index bf3b9f85e0..bd08940282 100644 --- a/patches/minecraft/net/minecraft/world/level/block/entity/BlockEntity.java.patch +++ b/patches/minecraft/net/minecraft/world/level/block/entity/BlockEntity.java.patch @@ -37,7 +37,7 @@ p_58895_.m_128405_("x", this.f_58858_.m_123341_()); p_58895_.m_128405_("y", this.f_58858_.m_123342_()); p_58895_.m_128405_("z", this.f_58858_.m_123343_()); -+ if (this.customTileData != null) p_58895_.m_128365_("ForgeData", this.customTileData); ++ if (this.customTileData != null) p_58895_.m_128365_("ForgeData", this.customTileData.m_6426_()); + if (getCapabilities() != null) p_58895_.m_128365_("ForgeCaps", serializeCaps()); return p_58895_; }