Use default state a bit more.

This commit is contained in:
Matthew Miller
2018-06-19 11:55:35 +10:00
parent 282eca7663
commit 70aceb3837
16 changed files with 59 additions and 54 deletions

View File

@@ -21,6 +21,7 @@ package com.sk89q.worldedit.command.tool;
import com.sk89q.worldedit.*;
import com.sk89q.worldedit.blocks.BaseBlock;
import com.sk89q.worldedit.blocks.type.BlockState;
import com.sk89q.worldedit.blocks.type.BlockType;
import com.sk89q.worldedit.blocks.type.BlockTypes;
import com.sk89q.worldedit.entity.Player;
@@ -37,7 +38,7 @@ import java.util.Set;
*/
public class RecursivePickaxe implements BlockTool {
private static final BaseBlock air = new BaseBlock(BlockTypes.AIR);
private static final BlockState air = BlockTypes.AIR.getDefaultState();
private double range;
public RecursivePickaxe(double range) {

View File

@@ -54,7 +54,7 @@ public class SinglePickaxe implements BlockTool {
editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop);
try {
editSession.setBlock(clicked.toVector(), new BaseBlock(BlockTypes.AIR));
editSession.setBlock(clicked.toVector(), BlockTypes.AIR.getDefaultState());
} catch (MaxChangedBlocksException e) {
player.printError("Max blocks change limit reached.");
} finally {

View File

@@ -38,7 +38,7 @@ public class CylinderBrush implements Brush {
@Override
public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException {
if (pattern == null) {
pattern = new BlockPattern(new BaseBlock(BlockTypes.COBBLESTONE));
pattern = new BlockPattern(BlockTypes.COBBLESTONE.getDefaultState());
}
editSession.makeCylinder(position, pattern, size, size, height, true);
}