Interface LocationBaseDataHolder.Mutable
- 
- All Superinterfaces:
- LocationBaseDataHolder
 - All Known Subinterfaces:
- Chunk<P>,- ClientWorld,- GenerationChunk,- GenerationRegion,- Schematic,- ServerWorld,- TrackedVolume,- World<W,L>,- WorldChunk,- WorldLike<P>
 - Enclosing interface:
- LocationBaseDataHolder
 
 public static interface LocationBaseDataHolder.Mutable extends LocationBaseDataHolder 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.game.LocationBaseDataHolderLocationBaseDataHolder.Mutable
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default DataTransactionResultcopyFrom(int xTo, int yTo, int zTo, int xFrom, int yFrom, int zFrom)Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position.DataTransactionResultcopyFrom(int xTo, int yTo, int zTo, int xFrom, int yFrom, int zFrom, MergeFunction function)Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position.DataTransactionResultcopyFrom(int xTo, int yTo, int zTo, ValueContainer from)Attempts to copy all the relevant data from the providedDataHolderto the block at the provided position.DataTransactionResultcopyFrom(int xTo, int yTo, int zTo, ValueContainer from, MergeFunction function)Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position.default DataTransactionResultcopyFrom(Vector3i to, ValueContainer from)Attempts to copy all the relevant data from the providedDataHolderto the block at the provided position.default DataTransactionResultcopyFrom(Vector3i to, ValueContainer from, MergeFunction function)Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position.default DataTransactionResultcopyFrom(Vector3i positionTo, Vector3i positionFrom)Attempts to copy all the relevant data from the providedDataHolderto the block at the provided position.default DataTransactionResultcopyFrom(Vector3i positionTo, Vector3i positionFrom, MergeFunction function)Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position.<E> DataTransactionResultoffer(int x, int y, int z, Key<? extends Value<E>> key, E value)Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.default <E> DataTransactionResultoffer(int x, int y, int z, Value<E> value)Offers the givenValueto the block at the given position.default <E> DataTransactionResultoffer(int x, int y, int z, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, E value)Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.default <E> DataTransactionResultoffer(Vector3i position, Key<? extends Value<E>> key, E value)Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.default <E> DataTransactionResultoffer(Vector3i position, Value<E> value)Offers the givenValueto the block at the given position.default <E> DataTransactionResultoffer(Vector3i position, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, E value)Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.DataTransactionResultremove(int x, int y, int z, Key<?> key)Attempts to remove the data associated with the providedKeyfrom the block at the provided location.default DataTransactionResultremove(int x, int y, int z, DefaultedRegistryReference<? extends Key<?>> key)Attempts to remove the data associated with the providedKeyfrom the block at the provided location.default DataTransactionResultremove(Vector3i position, Key<?> key)Attempts to remove the data associated with the providedKeyfrom the block at the provided location.default DataTransactionResultremove(Vector3i position, DefaultedRegistryReference<? extends Key<?>> key)Attempts to remove the data associated with the providedKeyfrom the block at the provided location.voidsetRawData(int x, int y, int z, DataView container)Attempts to set all data of the block at the given position according to theDataContainer's held information.default voidsetRawData(Vector3i position, DataView container)Attempts to set all data of the block at the given position according to theDataContainer's held information.default <E> DataTransactionResulttransform(int x, int y, int z, Key<? extends Value<E>> key, Function<E,E> function)Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.default <E> DataTransactionResulttransform(int x, int y, int z, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, Function<E,E> function)Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.default <E> DataTransactionResulttransform(Vector3i position, Key<? extends Value<E>> key, Function<E,E> function)Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.default <E> DataTransactionResulttransform(Vector3i position, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, Function<E,E> function)Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.DataTransactionResultundo(int x, int y, int z, DataTransactionResult result)Attempts to undo aDataTransactionResult.default DataTransactionResultundo(Vector3i position, DataTransactionResult result)Attempts to undo aDataTransactionResult.booleanvalidateRawData(int x, int y, int z, DataView container)Validates the container with known data required to set the raw data to the block at the given position.default booleanvalidateRawData(Vector3i position, DataView container)Validates the container with known data required to set the raw data to the block at the given position.- 
Methods inherited from interface org.spongepowered.api.world.volume.game.LocationBaseDataHolderget, get, get, get, getDouble, getDouble, getDouble, getDouble, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getValue, getValue, getValue, getValue, getValues, getValues, keys, keys, orElse, orElse, orElse, orElse, orElse, orElse, orElse, orElse, orNull, orNull, orNull, orNull, require, require, require, require, supports, supports, supports, supports, supports, supports
 
- 
 
- 
- 
- 
Method Detail- 
transformdefault <E> DataTransactionResult transform(Vector3i position, Key<? extends Value<E>> key, Function<E,E> function) Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.- Type Parameters:
- E- The type of data
- Parameters:
- position- The position of the block
- key- The key to the data
- function- The function applying the transformation
- Returns:
- The transaction result
 
 - 
transformdefault <E> DataTransactionResult transform(Vector3i position, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, Function<E,E> function) Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.- Type Parameters:
- E- The type of data
- Parameters:
- position- The position of the block
- key- The key to the data
- function- The function applying the transformation
- Returns:
- The transaction result
 
 - 
transformdefault <E> DataTransactionResult transform(int x, int y, int z, Key<? extends Value<E>> key, Function<E,E> function) Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.- Type Parameters:
- E- The type of data
- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- key- The key to the data
- function- The function applying the transformation
- Returns:
- The transaction result
 
 - 
transformdefault <E> DataTransactionResult transform(int x, int y, int z, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, Function<E,E> function) Applies a transformation on the pre-existing value of the data keyed by the providedKeyand returns aDataTransactionResultof said transformation.- Type Parameters:
- E- The type of data
- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- key- The key to the data
- function- The function applying the transformation
- Returns:
- The transaction result
 
 - 
offerdefault <E> DataTransactionResult offer(Vector3i position, Key<? extends Value<E>> key, E value) Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.If any data is rejected or existing data is replaced, the DataTransactionResultwill retain the rejected and replaced data.- Type Parameters:
- E- The type of data being offered
- Parameters:
- position- The position of the block
- key- The key for the data
- value- The value to offer
- Returns:
- The transaction result
 
 - 
offerdefault <E> DataTransactionResult offer(Vector3i position, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, E value) Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.If any data is rejected or existing data is replaced, the DataTransactionResultwill retain the rejected and replaced data.- Type Parameters:
- E- The type of data being offered
- Parameters:
- position- The position of the block
- key- The key for the data
- value- The value to offer
- Returns:
- The transaction result
 
 - 
offer<E> DataTransactionResult offer(int x, int y, int z, Key<? extends Value<E>> key, E value) Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.If any data is rejected or existing data is replaced, the DataTransactionResultwill retain the rejected and replaced data.- Type Parameters:
- E- The type of data being offered
- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- key- The key for the data
- value- The value to offer
- Returns:
- The transaction result
 
 - 
offerdefault <E> DataTransactionResult offer(int x, int y, int z, DefaultedRegistryReference<? extends Key<? extends Value<E>>> key, E value) Offers the givenEvalue that is keyed by the providedKeyto the block at the provided location.If any data is rejected or existing data is replaced, the DataTransactionResultwill retain the rejected and replaced data.- Type Parameters:
- E- The type of data being offered
- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- key- The key for the data
- value- The value to offer
- Returns:
- The transaction result
 
 - 
offerdefault <E> DataTransactionResult offer(Vector3i position, Value<E> value) Offers the givenValueto the block at the given position.If any data is rejected or existing data is replaced, the DataTransactionResultwill retain the rejected and replaced data.- Type Parameters:
- E- The type of the element wrapped by the value
- Parameters:
- position- The position of the block
- value- The value to offer
- Returns:
- The transaction result
 
 - 
offerdefault <E> DataTransactionResult offer(int x, int y, int z, Value<E> value) Offers the givenValueto the block at the given position.If any data is rejected or existing data is replaced, the DataTransactionResultwill retain the rejected and replaced data.- Type Parameters:
- E- The type of the element wrapped by the value
- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- value- The value to offer
- Returns:
- The transaction result
 
 - 
removedefault DataTransactionResult remove(Vector3i position, Key<?> key) Attempts to remove the data associated with the providedKeyfrom the block at the provided location.- Parameters:
- position- The position of the block
- key- The key to the data to remove
- Returns:
- The transaction result
 
 - 
removedefault DataTransactionResult remove(Vector3i position, DefaultedRegistryReference<? extends Key<?>> key) Attempts to remove the data associated with the providedKeyfrom the block at the provided location.- Parameters:
- position- The position of the block
- key- The key to the data to remove
- Returns:
- The transaction result
 
 - 
removeDataTransactionResult remove(int x, int y, int z, Key<?> key) Attempts to remove the data associated with the providedKeyfrom the block at the provided location.- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- key- The key of the data to remove
- Returns:
- The transaction result
 
 - 
removedefault DataTransactionResult remove(int x, int y, int z, DefaultedRegistryReference<? extends Key<?>> key) Attempts to remove the data associated with the providedKeyfrom the block at the provided location.- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- key- The key of the data to remove
- Returns:
- The transaction result
 
 - 
undodefault DataTransactionResult undo(Vector3i position, DataTransactionResult result) Attempts to undo aDataTransactionResult. Specifically, allValue.Immutables that were successfully added are removed, and all replacedValue.Immutables are offered.- Parameters:
- position- The position of the block
- result- The transaction result to undo
- Returns:
- The transaction result
 
 - 
undoDataTransactionResult undo(int x, int y, int z, DataTransactionResult result) Attempts to undo aDataTransactionResult. Specifically, allValue.Immutables that were successfully added are removed, and all replacedValue.Immutables are offered.- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- result- The transaction result to undo
- Returns:
- The transaction result
 
 - 
copyFromdefault DataTransactionResult copyFrom(Vector3i to, ValueContainer from) Attempts to copy all the relevant data from the providedDataHolderto the block at the provided position.- Parameters:
- to- The position of the block
- from- The data holder to copy data from
- Returns:
- The transaction result
 
 - 
copyFromDataTransactionResult copyFrom(int xTo, int yTo, int zTo, ValueContainer from) Attempts to copy all the relevant data from the providedDataHolderto the block at the provided position.- Parameters:
- xTo- The X pos
- yTo- The Y pos
- zTo- The Z pos
- from- The data holder to copy data from
- Returns:
- The transaction result
 
 - 
copyFromdefault DataTransactionResult copyFrom(Vector3i positionTo, Vector3i positionFrom) Attempts to copy all the relevant data from the providedDataHolderto the block at the provided position.- Parameters:
- positionTo- The position of the block
- positionFrom- The position of the block to copy data from
- Returns:
- The transaction result
 
 - 
copyFromdefault DataTransactionResult copyFrom(int xTo, int yTo, int zTo, int xFrom, int yFrom, int zFrom) Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position.- Parameters:
- xTo- The X position of the block to copy data to
- yTo- The Y position of the block to copy data to
- zTo- The Z position of the block to copy data to
- xFrom- The X position of the block to copy data from
- yFrom- The Y position of the block to copy data from
- zFrom- The Z position of the block to copy data from
- Returns:
- The transaction result
 
 - 
copyFromdefault DataTransactionResult copyFrom(Vector3i to, ValueContainer from, MergeFunction function) Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position. Any conflicting data is handled through the providedMergeFunction.- Parameters:
- to- The block position to copy to
- from- the data holder to copy data from
- function- The merge function to resolve conflicts
- Returns:
- The transaction result
 
 - 
copyFromDataTransactionResult copyFrom(int xTo, int yTo, int zTo, ValueContainer from, MergeFunction function) Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position. Any conflicting data is handled through the providedMergeFunction.- Parameters:
- xTo- The X pos of the block to copy data to
- yTo- The Y pos of the block to copy data to
- zTo- The Z pos of the block to copy data to
- from- The data holder to copy data from
- function- The merge function to resolve conflicts
- Returns:
- The transaction result
 
 - 
copyFromdefault DataTransactionResult copyFrom(Vector3i positionTo, Vector3i positionFrom, MergeFunction function) Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position. Any conflicting data is handled through the providedMergeFunction.- Parameters:
- positionTo- The position of the block copying data to
- positionFrom- The position of the block to copy data from
- function- The merge function to resolve conflicts
- Returns:
- The transaction result
 
 - 
copyFromDataTransactionResult copyFrom(int xTo, int yTo, int zTo, int xFrom, int yFrom, int zFrom, MergeFunction function) Attempts to copy allValue.Immutables from the provided block to provided block to the provided block position. Any conflicting data is handled through the providedMergeFunction.- Parameters:
- xTo- The X position
- yTo- The Y position
- zTo- The Z position
- xFrom- The X position
- yFrom- The Y position
- zFrom- The Z position
- function- The merge resolving function
- Returns:
- The transaction result
 
 - 
validateRawDatadefault boolean validateRawData(Vector3i position, DataView container) Validates the container with known data required to set the raw data to the block at the given position. If the container is incomplete or contains invalid data,falseis returned.This validation should be checked prior to calling setRawData(Vector3i, DataView)to avoid exceptions.- Parameters:
- position- The position of the block
- container- The raw data to validate
- Returns:
- True if the data is valid
 
 - 
validateRawDataboolean validateRawData(int x, int y, int z, DataView container)Validates the container with known data required to set the raw data to the block at the given position. If the container is incomplete or contains invalid data,falseis returned.This validation should be checked prior to calling setRawData(Vector3i, DataView)to avoid exceptions.- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- container- The raw data to validate
- Returns:
- True if the data is valid
 
 - 
setRawDatadefault void setRawData(Vector3i position, DataView container) throws InvalidDataException Attempts to set all data of the block at the given position according to theDataContainer's held information. Using this to modify knownDataManipulators is unsupported and if the data is invalid, anInvalidDataExceptionis thrown.This setter is used to provide setting custom data that is not represented by the Data API, including forge mods and other unknown data. Attempts at validating known DataManipulators contained in the data container are made with the assumption that all necessary data exists.- Parameters:
- position- The position of the block
- container- A container containing all raw data to set on the block at the given position
- Throws:
- InvalidDataException- If the container is missing or has invalid data that this holder will refuse
 
 - 
setRawDatavoid setRawData(int x, int y, int z, DataView container) throws InvalidDataExceptionAttempts to set all data of the block at the given position according to theDataContainer's held information. Using this to modify knownDataManipulators is unsupported and if the data is invalid, anInvalidDataExceptionis thrown.This setter is used to provide setting custom data that is not represented by the Data API, including forge mods and other unknown data. Attempts at validating known DataManipulators contained in the data container are made with the assumption that all necessary data exists.- Parameters:
- x- The X position
- y- The Y position
- z- The Z position
- container- A container containing all raw data to set on the block at the given position
- Throws:
- InvalidDataException- If the container is missing or has invalid data that this holder will refuse
 
 
- 
 
-