Package com.plotsquared.core.util
Class BlockUtil
java.lang.Object
com.plotsquared.core.util.BlockUtil
BlockState related utility methods-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable com.sk89q.worldedit.world.block.BlockStatedeserialize(@NonNull Map<String,Object> map)Deserialize a serializedBlockStatestatic @Nullable com.sk89q.worldedit.world.block.BlockStateget(int id)Get aBlockStatefrom a legacy idstatic @Nullable com.sk89q.worldedit.world.block.BlockStateget(int id, int data)Get aBlockStatefrom a legacy id-data pairstatic @Nullable com.sk89q.worldedit.world.block.BlockStateGet aBlockStatefrom its IDstatic @NonNull com.sk89q.worldedit.world.block.BlockState[]Parse a comma delimited list of block states
-
Method Details
-
get
public static @Nullable com.sk89q.worldedit.world.block.BlockState get(int id)Get aBlockStatefrom a legacy id- Parameters:
id- Legacy ID- Returns:
- Block state, or
null
-
get
public static @Nullable com.sk89q.worldedit.world.block.BlockState get(int id, int data)Get aBlockStatefrom a legacy id-data pair- Parameters:
id- Legacy IDdata- Legacy data- Returns:
- Block state, or
null
-
get
Get aBlockStatefrom its ID- Parameters:
id- String or integer ID- Returns:
- Parsed block state, or
nullif none could be parsed
-
parse
public static @NonNull com.sk89q.worldedit.world.block.BlockState[] parse(@NonNull String commaDelimited)Parse a comma delimited list of block states- Parameters:
commaDelimited- List of block states- Returns:
- Parsed block states
-
deserialize
public static @Nullable com.sk89q.worldedit.world.block.BlockState deserialize(@NonNull Map<String,Object> map)Deserialize a serializedBlockState- Parameters:
map- Serialized block state- Returns:
- Deserialized block state, or
nullif the map is not a properly serialized block state
-