From f729b5509c58fdfe824d9b4eb2ec6a66305ba800 Mon Sep 17 00:00:00 2001 From: XxFran10xX <318299142+XxFran10xX@users.noreply.github.com> Date: Mon, 28 Sep 2026 23:06:29 +0200 Subject: [PATCH] fix: keep slot display data when placing carried furniture Placing a carried piece reset every slot to its default transform. A plugin's per-slot display data was lost, so a half-eaten pot of soup refilled to the brim and its hidden mashed pieces showed again. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../interactiblefurniture/furniture/Furniture.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/tfminecraft/interactiblefurniture/furniture/Furniture.java b/src/main/java/net/tfminecraft/interactiblefurniture/furniture/Furniture.java index dec7bcf..0cb23b6 100644 --- a/src/main/java/net/tfminecraft/interactiblefurniture/furniture/Furniture.java +++ b/src/main/java/net/tfminecraft/interactiblefurniture/furniture/Furniture.java @@ -17,6 +17,7 @@ import net.tfminecraft.interactiblefurniture.InteractibleFurniture; import net.tfminecraft.interactiblefurniture.database.Database; +import net.tfminecraft.interactiblefurniture.furniture.data.DisplayData; import net.tfminecraft.interactiblefurniture.loaders.FurnitureLoader; import net.tfminecraft.interactiblefurniture.manager.FurnitureManager; import net.tfminecraft.interactiblefurniture.manager.handlers.FurnitureBreakHandler; @@ -295,12 +296,14 @@ public void setFromDisplay(ItemDisplay newDisplay, Block block, BlockFace face) display.teleport(newDisplay.getLocation()); display.setBrightness(null); - // Reset slot origins (necessary so slots follow correctly after placement) + // Reset slot origins (necessary so slots follow correctly after placement). + // Keep each slot's display data: a plugin may have moved or hidden it (a pot's soup level). for (PlacedSlot slot : activeSlots.values()) { SlotDefinition def = slot.getDefinition(); if (def == null) continue; - Location newLoc = def.computeDisplayLocation(loc, display, null); - Transformation t = def.buildFinalTransformation(display, null); + DisplayData data = slot.getCurrentDisplayData(); + Location newLoc = def.computeDisplayLocation(loc, display, data); + Transformation t = def.buildFinalTransformation(display, data); ItemDisplay slotDisplay = (ItemDisplay) Bukkit.getEntity(slot.getDisplayStandId()); if(slotDisplay == null) continue; slotDisplay.teleport(newLoc);