mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-24 05:21:16 +00:00
start working on error handling stuff
This commit is contained in:
@@ -64,17 +64,17 @@ public class CLIBlockState implements BlockState {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockType getBlockType() {
|
||||
public BlockType blockType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAsString(boolean properties) {
|
||||
public String asString(boolean properties) {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAir() {
|
||||
public boolean air() {
|
||||
return isAir;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,17 +25,17 @@ public class CLIBlockType implements BlockType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState getDefaultState() {
|
||||
public BlockState defaultState() {
|
||||
return defaultState.value();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSolid() {
|
||||
public boolean solid() {
|
||||
return solid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWater() {
|
||||
public boolean water() {
|
||||
return water;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.dfsek.terra.cli.handle;
|
||||
|
||||
import com.dfsek.terra.api.error.Invalid;
|
||||
import com.dfsek.terra.api.util.generic.data.types.Either;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
@@ -16,8 +18,8 @@ public class CLIWorldHandle implements WorldHandle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull BlockState createBlockState(@NotNull String data) {
|
||||
return new CLIBlockState(data);
|
||||
public @NotNull Either<Invalid, BlockState> createBlockState(@NotNull String data) {
|
||||
return Either.right(new CLIBlockState(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user