Package com.enhancedechest.gui
Class EnderChestAnimator
java.lang.Object
com.enhancedechest.gui.EnderChestAnimator
Triggers the vanilla ender chest open/close lid animation and sound.
Uses the pure Paper API (
Lidded) — no NMS, no reflection.
Lidded#open() / Lidded#close() send the vanilla BlockAction to nearby
clients (animating the lid) and play the open/close sound, exactly like a real chest.
Needed because the plugin opens a custom GUI inventory instead of the real ender chest
inventory, so vanilla never animates the block on its own.
Silently degrades (no-op) if the block is missing/not an ender chest, or if the running
server build doesn't expose Lidded on ender chests.
Thread requirement: must be called on the region thread that owns the block's chunk
(Folia) or the main thread (Paper). Callers already dispatch via runAtLocation.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(org.bukkit.entity.Player player, org.bukkit.Location blockLoc) Plays the close animation and sound on the ender chest atblockLoc.static voidopen(org.bukkit.entity.Player player, org.bukkit.Location blockLoc) Plays the open animation and sound on the ender chest atblockLoc.
-
Method Details
-
open
public static void open(org.bukkit.entity.Player player, org.bukkit.Location blockLoc) Plays the open animation and sound on the ender chest atblockLoc. Call this when the player opens the custom GUI via block right-click. -
close
public static void close(org.bukkit.entity.Player player, org.bukkit.Location blockLoc) Plays the close animation and sound on the ender chest atblockLoc. Call this when the player closes the custom GUI.
-