From e8169afd6453fc29f94ace7c4132f733a8323961 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 19 Feb 2021 19:58:36 +0100 Subject: [PATCH] Boost TileEntity clear performance, with extra boost on Paper --- .../main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 78d9e8de7..41a2a59ae 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -248,8 +248,12 @@ public class BukkitWorld extends AbstractWorld { @Override public boolean clearContainerBlockContents(BlockVector3 pt) { + checkNotNull(pt); + if (getBlock(pt).getBlockType().getMaterial().hasContainer()) { + return false; + } Block block = getWorld().getBlockAt(pt.getBlockX(), pt.getBlockY(), pt.getBlockZ()); - BlockState state = block.getState(); + BlockState state = PaperLib.getBlockState(block, false).getState(); if (!(state instanceof InventoryHolder)) { return false; }