Package cn.nukkit.blockstate
Class BlockStateRepair
java.lang.Object
cn.nukkit.blockstate.BlockStateRepair
- Author:
- joserobjr
-
Constructor Summary
ConstructorDescriptionBlockStateRepair
(int blockId, BlockProperties properties, Number originalState, Number currentState, Number nextState, int repairs, BlockProperty<?> property, int propertyOffset, int brokenPropertyMeta, Serializable fixedPropertyValue, Serializable proposedPropertyValue, InvalidBlockPropertyException validationException) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
The block ID of the block state that is being repaired.int
The current invalid int value that is in the property bit space.The current state that is being repaired.The property value that can be set to fix the current block state.The state after the repair.The state that was originally received when the repair started.The block properties of the block stat that is being repaired.The property that reported the invalid state,null
if all the properties was validated but the state have more bits to validate.int
The bit position of the invalid property value, whengetProperty()
isnull
this indicates the start index of thegetBrokenPropertyMeta()
.The proposed property int value to fix the current block state, if the proposed value is not validgetFixedPropertyValue()
will be used.int
How many repairs was applied to the original state.The exception that was thrown when trying to validate thegetCurrentState()
and resulted in this repair.int
hashCode()
toString()
-
Constructor Details
-
BlockStateRepair
@PowerNukkitOnly public BlockStateRepair(int blockId, @Nonnull BlockProperties properties, @Nonnull Number originalState, @Nonnull Number currentState, @Nonnull Number nextState, int repairs, @Nullable BlockProperty<?> property, int propertyOffset, int brokenPropertyMeta, @Nonnull Serializable fixedPropertyValue, @Nonnull Serializable proposedPropertyValue, @Nullable InvalidBlockPropertyException validationException)
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getBlockId
The block ID of the block state that is being repaired. -
getProperties
The block properties of the block stat that is being repaired. -
getOriginalState
The state that was originally received when the repair started. -
getCurrentState
The current state that is being repaired. -
getNextState
The state after the repair. It does not considergetProposedPropertyValue()
. -
getRepairs
How many repairs was applied to the original state. -
getProperty
The property that reported the invalid state,null
if all the properties was validated but the state have more bits to validate. -
getPropertyOffset
The bit position of the invalid property value, whengetProperty()
isnull
this indicates the start index of thegetBrokenPropertyMeta()
. -
getBrokenPropertyMeta
The current invalid int value that is in the property bit space. If thegetProperty()
isnull
than it will hold all remaining data that can be stored in an integer -
getFixedPropertyValue
The property value that can be set to fix the current block state. It's usually the default property value. -
getProposedPropertyValue
The proposed property int value to fix the current block state, if the proposed value is not validgetFixedPropertyValue()
will be used. -
getValidationException
The exception that was thrown when trying to validate thegetCurrentState()
and resulted in this repair.
-