mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-05 20:36:42 +00:00
I guarantee this is broken. Start some form of string ID for blocks
This commit is contained in:
@ -24,6 +24,7 @@ import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
import com.sk89q.worldedit.blocks.type.BlockTypes;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
@ -106,10 +107,10 @@ public class FloraGenerator implements RegionFunction {
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
BaseBlock block = editSession.getBlock(position);
|
||||
|
||||
if (block.getType() == BlockID.GRASS) {
|
||||
if (block.getType().getId().equals(BlockTypes.GRASS)) {
|
||||
editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position));
|
||||
return true;
|
||||
} else if (block.getType() == BlockID.SAND) {
|
||||
} else if (block.getType().getLegacyId() == BlockID.SAND) {
|
||||
editSession.setBlock(position.add(0, 1, 0), desertPattern.apply(position));
|
||||
return true;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class ForestGenerator implements RegionFunction {
|
||||
@Override
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
BaseBlock block = editSession.getBlock(position);
|
||||
int t = block.getType();
|
||||
int t = block.getType().getLegacyId();
|
||||
|
||||
if (t == BlockID.GRASS || t == BlockID.DIRT) {
|
||||
treeGenerator.generate(editSession, position.add(0, 1, 0));
|
||||
|
@ -25,6 +25,7 @@ import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
import com.sk89q.worldedit.blocks.BlockID;
|
||||
import com.sk89q.worldedit.blocks.type.BlockTypes;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
import com.sk89q.worldedit.function.pattern.BlockPattern;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
@ -159,11 +160,11 @@ public class GardenPatchGenerator implements RegionFunction {
|
||||
|
||||
@Override
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
if (editSession.getBlock(position).getType() != BlockID.AIR) {
|
||||
if (!editSession.getBlock(position).getType().getId().equals(BlockTypes.AIR)) {
|
||||
position = position.add(0, 1, 0);
|
||||
}
|
||||
|
||||
if (editSession.getBlock(position.add(0, -1, 0)).getType() != BlockID.GRASS) {
|
||||
if (!editSession.getBlock(position.add(0, -1, 0)).getType().getId().equals(BlockTypes.GRASS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class ExistingBlockMask extends AbstractExtentMask {
|
||||
|
||||
@Override
|
||||
public boolean test(Vector vector) {
|
||||
return getExtent().getLazyBlock(vector).getType() != BlockID.AIR;
|
||||
return getExtent().getLazyBlock(vector).getType().getLegacyId() != BlockID.AIR;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -36,7 +36,7 @@ public class SolidBlockMask extends AbstractExtentMask {
|
||||
public boolean test(Vector vector) {
|
||||
Extent extent = getExtent();
|
||||
BaseBlock lazyBlock = extent.getLazyBlock(vector);
|
||||
return !BlockType.canPassThrough(lazyBlock.getType(), lazyBlock.getData());
|
||||
return !BlockType.canPassThrough(lazyBlock.getType().getLegacyId(), lazyBlock.getData());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
Reference in New Issue
Block a user