Add a Paper fast-path for DoubleChest#getLeftSide when possible

This commit is contained in:
Madeline Miller 2024-03-31 20:24:14 +10:00 committed by wizjany
parent c7319f10dc
commit 0d824d375b

View File

@ -54,7 +54,7 @@ private Object transform(InventoryHolder holder) {
if (holder instanceof BlockState blockState) {
return new BlockMaterialKey(blockState);
} else if (holder instanceof DoubleChest doubleChest) {
InventoryHolder left = doubleChest.getLeftSide();
InventoryHolder left = PaperLib.isPaper() ? doubleChest.getLeftSide(false) : doubleChest.getLeftSide();
if (left instanceof Chest chest) {
return new BlockMaterialKey(chest);
} else {