mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Get it to a point where it works minimally on 1.13 Spigot.
This commit is contained in:
@ -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 + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user