Further BaseBlock modernisation

This commit is contained in:
Matthew Miller
2018-06-18 17:53:33 +10:00
parent 811f1d4433
commit e99190225e
61 changed files with 344 additions and 787 deletions

View File

@ -50,7 +50,7 @@ public class AreaPickaxe implements BlockTool {
int ox = clicked.getBlockX();
int oy = clicked.getBlockY();
int oz = clicked.getBlockZ();
BlockType initialType = clicked.getExtent().getBlock(clicked.toVector()).getType();
BlockType initialType = clicked.getExtent().getBlock(clicked.toVector()).getBlockType();
if (initialType == BlockTypes.AIR) {
return true;
@ -68,7 +68,7 @@ public class AreaPickaxe implements BlockTool {
for (int y = oy - range; y <= oy + range; ++y) {
for (int z = oz - range; z <= oz + range; ++z) {
Vector pos = new Vector(x, y, z);
if (editSession.getBlock(pos).getType() != initialType) {
if (editSession.getBlock(pos).getBlockType() != initialType) {
continue;
}

View File

@ -67,7 +67,7 @@ public class BlockReplacer implements DoubleActionBlockTool {
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
EditSession editSession = session.createEditSession(player);
targetBlock = (editSession).getBlock(clicked.toVector());
BlockType type = targetBlock.getType().getLegacyType();
BlockType type = targetBlock.getBlockType().getLegacyType();
if (type != null) {
player.print("Replacer tool switched to: " + type.getName());

View File

@ -81,7 +81,7 @@ public class FloatingTreeRemover implements BlockTool {
}
for (Vector blockVector : blockSet) {
final int typeId = editSession.getBlock(blockVector).getType().getLegacyId();
final int typeId = editSession.getBlock(blockVector).getBlockType().getLegacyId();
switch (typeId) {
case BlockID.LOG:
case BlockID.LOG2:

View File

@ -54,7 +54,7 @@ public class FloodFillTool implements BlockTool {
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
World world = (World) clicked.getExtent();
BlockType initialType = world.getLazyBlock(clicked.toVector()).getType();
BlockType initialType = world.getLazyBlock(clicked.toVector()).getBlockType();
if (initialType == BlockTypes.AIR) {
return true;
@ -87,7 +87,7 @@ public class FloodFillTool implements BlockTool {
visited.add(pos);
if (editSession.getBlock(pos).getType() == initialType) {
if (editSession.getBlock(pos).getBlockType() == initialType) {
editSession.setBlock(pos, pattern.apply(pos));
} else {
return;

View File

@ -55,7 +55,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
if (pos == null) return false;
EditSession eS = session.createEditSession(player);
try {
if (secondary.getType() == BlockTypes.AIR) {
if (secondary.getBlockType() == BlockTypes.AIR) {
eS.setBlock(pos.toVector(), secondary);
} else {
eS.setBlock(pos.getDirection(), secondary);
@ -74,7 +74,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
if (pos == null) return false;
EditSession eS = session.createEditSession(player);
try {
if (primary.getType() == BlockTypes.AIR) {
if (primary.getBlockType() == BlockTypes.AIR) {
eS.setBlock(pos.toVector(), primary);
} else {
eS.setBlock(pos.getDirection(), primary);

View File

@ -48,8 +48,8 @@ public class QueryTool implements BlockTool {
BaseBlock block = editSession.getBlock(clicked.toVector());
player.print("\u00A79@" + clicked.toVector() + ": " + "\u00A7e"
+ "#" + block.getType() + "\u00A77" + " ("
+ block.getType().getId() + ") "
+ "#" + block.getBlockType() + "\u00A77" + " ("
+ block.getBlockType().getId() + ") "
+ "\u00A7f"
+ "[" + block.getStates().toString() + "]" + " (" + world.getBlockLightLevel(clicked.toVector()) + "/" + world.getBlockLightLevel(clicked.toVector().add(0, 1, 0)) + ")");

View File

@ -53,7 +53,7 @@ public class RecursivePickaxe implements BlockTool {
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
World world = (World) clicked.getExtent();
BlockType initialType = world.getBlock(clicked.toVector()).getType();
BlockType initialType = world.getBlock(clicked.toVector()).getBlockType();
if (initialType == BlockTypes.AIR) {
return true;
@ -89,7 +89,7 @@ public class RecursivePickaxe implements BlockTool {
visited.add(pos);
if (editSession.getBlock(pos).getType() != initialType) {
if (editSession.getBlock(pos).getBlockType() != initialType) {
return;
}

View File

@ -44,7 +44,7 @@ public class SinglePickaxe implements BlockTool {
@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
World world = (World) clicked.getExtent();
final BlockType blockType = world.getLazyBlock(clicked.toVector()).getType();
final BlockType blockType = world.getLazyBlock(clicked.toVector()).getBlockType();
if (blockType == BlockTypes.BEDROCK
&& !player.canDestroyBedrock()) {
return true;