mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 04:28:34 +00:00
Add a material to check if air is air, because there are now 3 types of air.
This commit is contained in:
@ -37,7 +37,7 @@ public abstract class BlockBag {
|
||||
public void storeDroppedBlock(BlockState blockState) throws BlockBagException {
|
||||
BlockState dropped = blockState; // TODO BlockType.getBlockBagItem(id, data);
|
||||
if (dropped == null) return;
|
||||
if (dropped.getBlockType() == BlockTypes.AIR) return;
|
||||
if (dropped.getBlockType().getMaterial().isAir()) return;
|
||||
|
||||
storeBlock(dropped);
|
||||
}
|
||||
@ -57,7 +57,7 @@ public abstract class BlockBag {
|
||||
fetchBlock(blockState);
|
||||
} catch (OutOfBlocksException e) {
|
||||
BlockState placed = blockState;// TODO BlockType.getBlockBagItem(id, data);
|
||||
if (placed == null || placed.getBlockType() == BlockTypes.AIR) throw e; // TODO: check
|
||||
if (placed == null || placed.getBlockType().getMaterial().isAir()) throw e; // TODO: check
|
||||
|
||||
fetchBlock(placed);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class BlockBagExtent extends AbstractDelegateExtent {
|
||||
if (blockBag != null) {
|
||||
BlockState existing = getExtent().getBlock(position);
|
||||
|
||||
if (block.getBlockType() != BlockTypes.AIR) {
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
try {
|
||||
blockBag.fetchPlacedBlock(block.toImmutableState());
|
||||
} catch (UnplaceableBlockException e) {
|
||||
@ -102,7 +102,7 @@ public class BlockBagExtent extends AbstractDelegateExtent {
|
||||
}
|
||||
}
|
||||
|
||||
if (existing.getBlockType() != BlockTypes.AIR) {
|
||||
if (!existing.getBlockType().getMaterial().isAir()) {
|
||||
try {
|
||||
blockBag.storeDroppedBlock(existing);
|
||||
} catch (BlockBagException ignored) {
|
||||
|
@ -81,7 +81,7 @@ public class SurvivalModeExtent extends AbstractDelegateExtent {
|
||||
|
||||
@Override
|
||||
public boolean setBlock(Vector location, BlockStateHolder block) throws WorldEditException {
|
||||
if (toolUse && block.getBlockType() == BlockTypes.AIR) {
|
||||
if (toolUse && block.getBlockType().getMaterial().isAir()) {
|
||||
world.simulateBlockMine(location);
|
||||
return true;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user