mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 04:46:40 +00:00
Add a material to check if air is air, because there are now 3 types of air.
This commit is contained in:
@ -154,7 +154,7 @@ public class OldChunk implements Chunk {
|
||||
|
||||
@Override
|
||||
public BaseBlock getBlock(Vector position) throws DataException {
|
||||
if(position.getBlockY() >= 128) BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
if(position.getBlockY() >= 128) BlockTypes.VOID_AIR.getDefaultState().toBaseBlock();
|
||||
int id, dataVal;
|
||||
|
||||
int x = position.getBlockX() - rootX * 16;
|
||||
|
@ -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