mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-29 00:09:01 +00:00
Clarify documentation refers to each transform function
This commit is contained in:
3 files changed
+6
-4
No files matched your search
@@ -20,7 +20,8 @@ import javax.annotation.Nonnull;
|
||||
/// Custom world storage offered through [CustomDataReplacementManager] is stamped the same way and reaches
|
||||
/// [#transformCustomData].
|
||||
///
|
||||
/// A transformer that rewrites item stacks extends [VersionedStackTransformer], which covers every pass.
|
||||
/// A transformer that rewrites item stacks extends [VersionedStackTransformer], which covers every `transform`
|
||||
/// function.
|
||||
public interface IVersionedTransformer {
|
||||
|
||||
/// Default value when a transformer has not yet stamped a given data store.
|
||||
|
||||
@@ -10,7 +10,8 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
/// A versioned transformer that rewrites every saved item stack, in chunks, player data and custom world storage alike.
|
||||
/// A subclass that also rewrites blocks overrides [#transformChunk] and calls `super`.
|
||||
///
|
||||
/// Each pass calls [#stackTransform] once, before visiting any stack.
|
||||
/// Each `transform` function calls [#stackTransform] just once, to obtain the transform consumer before iterating
|
||||
/// over all item stacks.
|
||||
public abstract class VersionedStackTransformer implements IVersionedTransformer {
|
||||
|
||||
/// The rewrite applied to each stack tag in data stamped at `storedVersion`, or null when that data needs none. In
|
||||
|
||||
@@ -7,13 +7,13 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
class VersionedStackTransformerTest {
|
||||
|
||||
/// Bumps every stack's damage by one, or rewrites nothing when `rewrite` is false.
|
||||
|
||||
Reference in new issue
Block a user