mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 20:43:54 +00:00
Add a material to check if air is air, because there are now 3 types of air.
This commit is contained in:
@ -60,6 +60,11 @@ public class BukkitBlockRegistry extends BundledBlockRegistry {
|
||||
this.material = bukkitMaterial;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir() {
|
||||
return material == Material.AIR || material == Material.CAVE_AIR || material == Material.VOID_AIR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSolid() {
|
||||
return material.isSolid();
|
||||
|
@ -64,7 +64,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
|
||||
|
||||
@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");
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
|
||||
|
||||
@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()) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user