Package cn.nukkit.blockstate
Class MutableBlockState
java.lang.Object
cn.nukkit.blockstate.MutableBlockState
- All Implemented Interfaces:
IBlockState
,IMutableBlockState
- Direct Known Subclasses:
BigIntegerMutableBlockState
,ByteMutableBlockState
,IntMutableBlockState
,LongMutableBlockState
,ZeroMutableBlockState
@PowerNukkitOnly
@Since("1.4.0.0-PN")
@ParametersAreNonnullByDefault
public abstract class MutableBlockState
extends Object
implements IMutableBlockState
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
abstract MutableBlockState
copy()
boolean
final long
getBigId()
Deprecated.final int
final int
final int
Deprecated.final BlockProperties
int
hashCode()
void
setState
(IBlockState state) Replace all matching states of this block state with the same states of the given block state.toString()
abstract void
validate()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface cn.nukkit.blockstate.IBlockState
asItemBlock, asItemBlock, getBigDamage, getBlock, getBlock, getBlock, getBlock, getBlock, getBlock, getBlock, getBlock, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBlockRepairing, getBooleanValue, getBooleanValue, getCheckedProperty, getCheckedPropertyValue, getCurrentState, getDataStorage, getExactIntStorage, getHugeDamage, getIntValue, getIntValue, getLegacyDamage, getLegacyStateId, getMinimalistStateId, getPersistenceName, getPersistenceValue, getPersistenceValue, getProperty, getPropertyNames, getPropertyValue, getPropertyValue, getRuntimeId, getSignedBigDamage, getStateId, getUncheckedPropertyValue, getUncheckedPropertyValue, isDefaultState
Methods inherited from interface cn.nukkit.blockstate.IMutableBlockState
forState, setBooleanValue, setBooleanValue, setDataStorage, setDataStorage, setDataStorage, setDataStorageFromInt, setDataStorageFromInt, setDataStorageFromInt, setDataStorageFromItemBlockMeta, setIntValue, setIntValue, setPropertyValue, setPropertyValue, toggleBooleanProperty, toggleBooleanProperty
-
Field Details
-
blockId
-
properties
-
-
Method Details
-
setState
@Since("1.4.0.0-PN") @PowerNukkitOnly public void setState(IBlockState state) throws InvalidBlockStateException Description copied from interface:IMutableBlockState
Replace all matching states of this block state with the same states of the given block state.States that doesn't exists in the other state are ignored.
Only properties that matches each other will be copied, for example, if this state have an age property going from 0 to 7 and the other have an age from 0 to 15, the age property won't change.
- Specified by:
setState
in interfaceIMutableBlockState
- Parameters:
state
- The states that will have the properties copied.- Throws:
InvalidBlockStateException
- If the given storage has invalid data properties
-
getProperties
- Specified by:
getProperties
in interfaceIBlockState
-
getBlockId
- Specified by:
getBlockId
in interfaceIBlockState
-
getFullId
@PowerNukkitOnly @Deprecated @DeprecationDetails(reason="Can\'t store all data, exists for backward compatibility reasons", since="1.4.0.0-PN", replaceWith="the BlockState itself") public final int getFullId()Deprecated.- Specified by:
getFullId
in interfaceIBlockState
-
getBigId
@Deprecated @DeprecationDetails(reason="Can\'t store all data, exists for backward compatibility reasons", since="1.4.0.0-PN", replaceWith="the BlockState itself") @PowerNukkitOnly public final long getBigId()Deprecated.- Specified by:
getBigId
in interfaceIBlockState
-
getBitSize
- Specified by:
getBitSize
in interfaceIBlockState
-
validate
- Throws:
InvalidBlockStateException
- if the state is invalid
-
copy
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-