Fixed a null pointer. Merged in a bunch of CLI stuff.

This commit is contained in:
MattBDev
2019-09-02 15:22:43 -04:00
parent aa4c443358
commit c20f4c6b7f
28 changed files with 240 additions and 352 deletions

View File

@ -34,6 +34,8 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.weather.WeatherType;
import com.sk89q.worldedit.world.weather.WeatherTypes;
import javax.annotation.Nullable;
import java.nio.file.Path;
import java.util.PriorityQueue;
@ -132,6 +134,23 @@ public abstract class AbstractWorld implements World {
return null;
}
@Override
public WeatherType getWeather() {
return WeatherTypes.CLEAR;
}
@Override
public long getRemainingWeatherDuration() {
return 0;
}
@Override
public void setWeather(WeatherType weatherType) {
}
@Override
public void setWeather(WeatherType weatherType, long duration) {
}
private class QueuedEffect implements Comparable<QueuedEffect> {
private final Vector3 position;
private final BlockType blockType;

View File

@ -63,6 +63,10 @@ public class NullWorld extends AbstractWorld {
return "null";
}
@Override
public String getId() {
return "null";
}
@Override
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position, B block, boolean notifyAndLight) throws WorldEditException {
return false;

View File

@ -106,10 +106,6 @@ public class ItemType implements RegistryItem, Keyed {
return this.blockType;
}
public void setBlockType(BlockType blockType) {
this.blockType = blockType;
}
public BaseItem getDefaultState() {
if (defaultState == null) {
this.defaultState = new BaseItemStack(this);

View File

@ -37,5 +37,7 @@ public interface CategoryRegistry<T extends Keyed> {
*/
Set<T> getCategorisedByName(String category);
Set<T> getAll(final Category<T> category);
default Set<T> getAll(final Category<T> category) {
return getCategorisedByName(category.getId());
}
}