mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 03:56:41 +00:00
Make BaseBlock more memory efficient, and make it clear in the API that it's not intended to be used for every single block.
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
|
||||
import java.util.Map;
|
||||
@ -66,12 +67,27 @@ public interface BlockStateHolder<T extends BlockStateHolder> {
|
||||
boolean equalsFuzzy(BlockStateHolder o);
|
||||
|
||||
/**
|
||||
* Returns an immutable BlockState from this BlockStateHolder.
|
||||
* Returns an immutable {@link BlockState} from this BlockStateHolder.
|
||||
*
|
||||
* @return A BlockState
|
||||
*/
|
||||
BlockState toImmutableState();
|
||||
|
||||
/**
|
||||
* Gets a {@link BaseBlock} from this BlockStateHolder.
|
||||
*
|
||||
* @return The BaseBlock
|
||||
*/
|
||||
BaseBlock toBaseBlock();
|
||||
|
||||
/**
|
||||
* Gets a {@link BaseBlock} from this BlockStateHolder.
|
||||
*
|
||||
* @param compoundTag The NBT Data to apply
|
||||
* @return The BaseBlock
|
||||
*/
|
||||
BaseBlock toBaseBlock(CompoundTag compoundTag);
|
||||
|
||||
default String getAsString() {
|
||||
if (getStates().isEmpty()) {
|
||||
return this.getBlockType().getId();
|
||||
|
Reference in New Issue
Block a user