mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
Add a material to check if air is air, because there are now 3 types of air.
This commit is contained in:
@ -24,6 +24,13 @@ package com.sk89q.worldedit.world.registry;
|
||||
*/
|
||||
public interface BlockMaterial {
|
||||
|
||||
/**
|
||||
* Gets if this block is a type of air.
|
||||
*
|
||||
* @return If it's air
|
||||
*/
|
||||
boolean isAir();
|
||||
|
||||
/**
|
||||
* Get whether this block is a full sized cube.
|
||||
*
|
||||
|
@ -29,6 +29,15 @@ public class PassthroughBlockMaterial implements BlockMaterial {
|
||||
this.blockMaterial = material;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir() {
|
||||
if (blockMaterial == null) {
|
||||
return false;
|
||||
} else {
|
||||
return blockMaterial.isAir();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
if (blockMaterial == null) {
|
||||
|
@ -21,6 +21,7 @@ package com.sk89q.worldedit.world.registry;
|
||||
|
||||
class SimpleBlockMaterial implements BlockMaterial {
|
||||
|
||||
private boolean isAir;
|
||||
private boolean fullCube;
|
||||
private boolean opaque;
|
||||
private boolean powerSource;
|
||||
@ -40,6 +41,15 @@ class SimpleBlockMaterial implements BlockMaterial {
|
||||
private boolean isTranslucent;
|
||||
private boolean hasContainer;
|
||||
|
||||
@Override
|
||||
public boolean isAir() {
|
||||
return this.isAir;
|
||||
}
|
||||
|
||||
public void setIsAir(boolean isAir) {
|
||||
this.isAir = isAir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube() {
|
||||
return fullCube;
|
||||
|
Reference in New Issue
Block a user