Package mcp.mobius.waila.api
Interface IDataWriter
Used to sync data.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescription<D extends IData>
voidadd
(IData.Type<D> type, Consumer<IDataWriter.Result<D>> consumer) Adds a typed data.void
addImmediate
(IData data) Immediately adds a typed data.default void
blockAll
(IData.Type<? extends IData> type) Blocks all lower priority provider unconditionally.raw()
Modify raw NBT data to be synced.
-
Method Details
-
raw
CompoundTag raw()Modify raw NBT data to be synced.Note: use a unique property name, as it can conflict with data from other plugins.
For more complex data, use typed data instead.
-
add
Adds a typed data.For simple data, consider using raw NBT data instead, as it is easier to do and enough for most purpose.
- Parameters:
type
- the type of the dataconsumer
- the consumer that will be called if necessary based on the provider priority. If earlier provider already added the data, or decided to block other provider, this will not be called.- See Also:
-
addImmediate
Immediately adds a typed data.Use this method only for internal data that only you use, otherwise use
add(IData.Type, Consumer)
instead.- Parameters:
data
- the data to add- Throws:
IllegalStateException
- if the data is already added, whether withadd(IData.Type, Consumer)
or this method
-
blockAll
Blocks all lower priority provider unconditionally.- Parameters:
type
- the type of the data that wanted to be blocked
-