Class BlockTransaction
java.lang.Object
org.spongepowered.api.data.Transaction<BlockSnapshot>
org.spongepowered.api.block.transaction.BlockTransaction
- All Implemented Interfaces:
DataSerializable
A specialized
Transaction<BlockSnapshot> that covers
the required changes of one BlockSnapshot to another, with the added benefit
of a contextual understanding of what sort of operation is being
performed to change from one block to another. It is possible to serialize a
particular transaction, but to associate a transaction with it's "post" state, refer
to the receipt variant that exposes only what
was and what is the final result.-
Constructor Summary
ConstructorsConstructorDescriptionBlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, @Nullable List<? extends BlockSnapshot> intermediary, Operation operation) BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, Operation operation) -
Method Summary
Modifier and TypeMethodDescriptionintGets the content version of thisDataSerializable.booleaninthashCode()Serializes this object into a comprehensibleDataContainer.toString()Methods inherited from class org.spongepowered.api.data.Transaction
custom, defaultReplacement, finalReplacement, intermediary, invalidate, isValid, original, setCustom, setValid, validate
-
Constructor Details
-
BlockTransaction
public BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, Operation operation) -
BlockTransaction
public BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, @Nullable List<? extends BlockSnapshot> intermediary, Operation operation)
-
-
Method Details
-
operation
-
hashCode
public int hashCode()- Overrides:
hashCodein classTransaction<BlockSnapshot>
-
equals
- Overrides:
equalsin classTransaction<BlockSnapshot>
-
toString
- Overrides:
toStringin classTransaction<BlockSnapshot>
-
contentVersion
public int contentVersion()Description copied from interface:DataSerializableGets the content version of thisDataSerializable. The version may differ between instances of plugins and implementations such that theDataViewfromDataSerializable.toContainer()may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdateras it is required when there exists anyDataViewof thisDataSerializablewith an "older" version.- Specified by:
contentVersionin interfaceDataSerializable- Overrides:
contentVersionin classTransaction<BlockSnapshot>- Returns:
- The version of the content being serialized
-
toContainer
Description copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
toContainerin interfaceDataSerializable- Overrides:
toContainerin classTransaction<BlockSnapshot>- Returns:
- A newly created DataContainer
-