This commit is contained in:
Jesse Boyd
2019-08-07 01:29:49 +10:00
parent a3c58a187e
commit a476ab1ea0
27 changed files with 461 additions and 485 deletions

View File

@ -32,6 +32,7 @@ import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.registry.Keyed;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.TreeGenerator;
import com.sk89q.worldedit.world.block.BlockState;
@ -41,11 +42,12 @@ import com.sk89q.worldedit.world.weather.WeatherType;
import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.Locale;
/**
* Represents a world (dimension).
*/
public interface World extends Extent {
public interface World extends Extent, Keyed {
/**
* Get the name of the world.
@ -284,4 +286,8 @@ public interface World extends Extent {
return true;
}
@Override
default String getId() {
return getName().replace(" ", "_").toLowerCase(Locale.ROOT);
}
}

View File

@ -182,7 +182,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
@Override
public void setNbtData(@Nullable CompoundTag nbtData) {
throw new UnsupportedOperationException("Immutable");
throw new UnsupportedOperationException("This class is immutable.");
}
/**
@ -239,7 +239,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
}
@Override
public final BaseBlock toBaseBlock() {
public BaseBlock toBaseBlock() {
return this;
}

View File

@ -301,6 +301,9 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
@Override
public boolean equalsFuzzy(BlockStateHolder<?> o) {
if (null == o) {
return false;
}
if (this == o) {
// Added a reference equality check for speediness
return true;
@ -308,9 +311,6 @@ public class BlockState implements BlockStateHolder<BlockState>, FawePattern {
if (o.getClass() == BlockState.class) {
return o.getOrdinal() == this.getOrdinal();
}
if (null == o) {
return false;
}
return o.equalsFuzzy(this);
}