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
ConstructorDescriptionBlockTransaction
(BlockSnapshot original, BlockSnapshot defaultReplacement, @Nullable List<? extends BlockSnapshot> intermediary, Operation operation) BlockTransaction
(BlockSnapshot original, BlockSnapshot defaultReplacement, Operation operation) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the content version of thisDataSerializable
.boolean
int
hashCode()
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:
hashCode
in classTransaction<BlockSnapshot>
-
equals
- Overrides:
equals
in classTransaction<BlockSnapshot>
-
toString
- Overrides:
toString
in classTransaction<BlockSnapshot>
-
contentVersion
public int contentVersion()Description copied from interface:DataSerializable
Gets the content version of thisDataSerializable
. The version may differ between instances of plugins and implementations such that theDataView
fromDataSerializable.toContainer()
may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdater
as it is required when there exists anyDataView
of thisDataSerializable
with an "older" version.- Specified by:
contentVersion
in interfaceDataSerializable
- Overrides:
contentVersion
in classTransaction<BlockSnapshot>
- Returns:
- The version of the content being serialized
-
toContainer
Description copied from interface:DataSerializable
Serializes this object into a comprehensibleDataContainer
.- Specified by:
toContainer
in interfaceDataSerializable
- Overrides:
toContainer
in classTransaction<BlockSnapshot>
- Returns:
- A newly created DataContainer
-