Get it to a point where it works minimally on 1.13 Spigot.

This commit is contained in:
Matthew Miller
2018-07-16 00:21:32 +10:00
parent 59ca29577c
commit 3e1d438565
16 changed files with 2751 additions and 70 deletions

View File

@ -22,6 +22,7 @@ package com.sk89q.worldedit.world.block;
import com.sk89q.worldedit.registry.state.Property;
import java.util.Map;
import java.util.stream.Collectors;
public interface BlockStateHolder<T extends BlockStateHolder> {
@ -70,4 +71,13 @@ public interface BlockStateHolder<T extends BlockStateHolder> {
* @return A BlockState
*/
BlockState toImmutableState();
default String getAsString() {
if (getStates().isEmpty()) {
return this.getBlockType().getId();
} else {
String properties = getStates().entrySet().stream().map(entry -> entry.getKey() + "=" + entry.getValue()).collect(Collectors.joining(","));
return this.getBlockType().getId() + "[" + properties + "]";
}
}
}