mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-06-26 06:14:44 +02:00
DoubleChest left/right side holder might be null/not BlockStates. Check that.
This commit is contained in:
parent
7d92cb820d
commit
aa7bfbb7ee
|
@ -46,8 +46,14 @@ public class PlayerInventory implements Listener {
|
||||||
List<Block> containers = new ArrayList<>();
|
List<Block> containers = new ArrayList<>();
|
||||||
|
|
||||||
if (holder instanceof DoubleChest) {
|
if (holder instanceof DoubleChest) {
|
||||||
containers.add(((BlockState) ((DoubleChest) holder).getLeftSide()).getBlock());
|
InventoryHolder leftSide = ((DoubleChest) holder).getLeftSide();
|
||||||
containers.add(((BlockState) ((DoubleChest) holder).getRightSide()).getBlock());
|
if (leftSide instanceof BlockState) {
|
||||||
|
containers.add(((BlockState) leftSide).getBlock());
|
||||||
|
}
|
||||||
|
InventoryHolder rightSide = ((DoubleChest) holder).getRightSide();
|
||||||
|
if (rightSide instanceof BlockState) {
|
||||||
|
containers.add(((BlockState) rightSide).getBlock());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
containers.add(((BlockState) holder).getBlock());
|
containers.add(((BlockState) holder).getBlock());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user