Class BlockTransaction
- java.lang.Object
-
- org.spongepowered.api.data.Transaction<BlockSnapshot>
-
- org.spongepowered.api.block.transaction.BlockTransaction
-
- All Implemented Interfaces:
DataSerializable
public final class BlockTransaction extends Transaction<BlockSnapshot>
A specializedTransaction<BlockSnapshot>that covers the required changes of oneBlockSnapshotto another, with the added benefit of a contextual understanding of what sort ofoperationis 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 tothe receipt variantthat exposes only what was and what is the final result.
-
-
Constructor Summary
Constructors Constructor Description BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, @Nullable List<? extends BlockSnapshot> intermediary, Operation operation)BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, Operation operation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcontentVersion()Gets the content version of thisDataSerializable.booleanequals(Object obj)inthashCode()Operationoperation()DataContainertoContainer()Serializes this object into a comprehensibleDataContainer.StringtoString()-
Methods inherited from class org.spongepowered.api.data.Transaction
custom, defaultReplacement, finalReplacement, intermediary, invalidate, isValid, original, setCustom, setValid, validate
-
-
-
-
Constructor Detail
-
BlockTransaction
public BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, Operation operation)
-
BlockTransaction
public BlockTransaction(BlockSnapshot original, BlockSnapshot defaultReplacement, @Nullable List<? extends BlockSnapshot> intermediary, Operation operation)
-
-
Method Detail
-
operation
public Operation operation()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classTransaction<BlockSnapshot>
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classTransaction<BlockSnapshot>
-
toString
public String 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
public DataContainer toContainer()
Description copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
toContainerin interfaceDataSerializable- Overrides:
toContainerin classTransaction<BlockSnapshot>- Returns:
- A newly created DataContainer
-
-