mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix height brush
This commit is contained in:
parent
e452fc9556
commit
00ac111e46
@ -221,21 +221,21 @@ public interface Extent extends InputExtent, OutputExtent {
|
|||||||
for (int d = 0; d <= clearance; d++) {
|
for (int d = 0; d <= clearance; d++) {
|
||||||
int y1 = y + d;
|
int y1 = y + d;
|
||||||
block = getLazyBlock(x, y1, z);
|
block = getLazyBlock(x, y1, z);
|
||||||
if (!block.getBlockType().getMaterial().isMovementBlocker() != state && block != EditSession.nullBlock) return y1 - offset;
|
if (!block.getMaterial().isMovementBlocker() != state && block.getBlockType() != BlockTypes.__RESERVED__) return y1 - offset;
|
||||||
int y2 = y - d;
|
int y2 = y - d;
|
||||||
block = getLazyBlock(x, y2, z);
|
block = getLazyBlock(x, y2, z);
|
||||||
if (!block.getBlockType().getMaterial().isMovementBlocker() != state && block != EditSession.nullBlock) return y2 + offset;
|
if (!block.getMaterial().isMovementBlocker() != state && block.getBlockType() != BlockTypes.__RESERVED__) return y2 + offset;
|
||||||
}
|
}
|
||||||
if (clearanceAbove != clearanceBelow) {
|
if (clearanceAbove != clearanceBelow) {
|
||||||
if (clearanceAbove < clearanceBelow) {
|
if (clearanceAbove < clearanceBelow) {
|
||||||
for (int layer = y - clearance - 1; layer >= minY; layer--) {
|
for (int layer = y - clearance - 1; layer >= minY; layer--) {
|
||||||
block = getLazyBlock(x, layer, z);
|
block = getLazyBlock(x, layer, z);
|
||||||
if (!block.getBlockType().getMaterial().isMovementBlocker() != state && block != EditSession.nullBlock) return layer + offset;
|
if (!block.getMaterial().isMovementBlocker() != state && block.getBlockType() != BlockTypes.__RESERVED__) return layer + offset;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int layer = y + clearance + 1; layer <= maxY; layer++) {
|
for (int layer = y + clearance + 1; layer <= maxY; layer++) {
|
||||||
block = getLazyBlock(x, layer, z);
|
block = getLazyBlock(x, layer, z);
|
||||||
if (!block.getBlockType().getMaterial().isMovementBlocker() != state && block != EditSession.nullBlock) return layer - offset;
|
if (!block.getMaterial().isMovementBlocker() != state && block.getBlockType() != BlockTypes.__RESERVED__) return layer - offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,9 @@ public class BlockStateImpl extends BlockState {
|
|||||||
|
|
||||||
public BlockMaterial getMaterial() {
|
public BlockMaterial getMaterial() {
|
||||||
if (this.material == null) {
|
if (this.material == null) {
|
||||||
|
if (type == BlockTypes.__RESERVED__) {
|
||||||
|
return this.material = type.getMaterial();
|
||||||
|
}
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (this.material == null) {
|
if (this.material == null) {
|
||||||
this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);
|
this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user