What are the dud BlockCategories?

This commit is contained in:
Jesse Boyd
2018-08-14 11:00:44 +10:00
parent 76a55b7712
commit 1740c845d2
13 changed files with 40 additions and 31 deletions

View File

@ -63,7 +63,7 @@ public class BukkitPlayerBlockBag extends BlockBag implements SlottableBlockBag
@Override
public void fetchBlock(BlockState blockState) throws BlockBagException {
if (blockState.getBlockType() == BlockTypes.AIR) {
if (blockState.getBlockType().getMaterial().isAir()) {
throw new IllegalArgumentException("Can't fetch air block");
}
@ -107,7 +107,7 @@ public class BukkitPlayerBlockBag extends BlockBag implements SlottableBlockBag
@Override
public void storeBlock(BlockState blockState, int amount) throws BlockBagException {
if (blockState.getBlockType() == BlockTypes.AIR) {
if (blockState.getBlockType().getMaterial().isAir()) {
throw new IllegalArgumentException("Can't store air block");
}
if (!blockState.getBlockType().hasItemType()) {

View File

@ -59,7 +59,7 @@ public class EditSessionBlockChangeDelegate implements BlockChangeDelegate {
@Override
public boolean isEmpty(int x, int y, int z) {
return editSession.getBlock(new Vector(x, y, z)).getBlockType() == BlockTypes.AIR;
return editSession.getBlock(new Vector(x, y, z)).getBlockType().getMaterial().isAir();
}
}