Boost TileEntity clear performance, with extra boost on Paper

Dieser Commit ist enthalten in:
NotMyFault 2021-02-19 19:58:36 +01:00
Ursprung 14c0d4a5e8
Commit e8169afd64
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 158F5701A6AAD00C

Datei anzeigen

@ -248,8 +248,12 @@ public class BukkitWorld extends AbstractWorld {
@Override @Override
public boolean clearContainerBlockContents(BlockVector3 pt) { 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()); 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)) { if (!(state instanceof InventoryHolder)) {
return false; return false;
} }