Class IContainerMirror

java.lang.Object
com.saicone.rtag.item.mirror.IContainerMirror
All Implemented Interfaces:
ItemMirror
Direct Known Subclasses:
IShulkerMirror

public class IContainerMirror extends Object implements ItemMirror
IContainerMirror class to convert items inside item form of container across versions.
  • Constructor Details

    • IContainerMirror

      public IContainerMirror(ItemTagStream stream, boolean component)
      Constructs an IContainerMirror with specified ItemTagStream to convert loaded items.
      Parameters:
      stream - ItemTagStream instance.
      component - True if container component should be used.
  • Method Details

    • getMinimumVersion

      @NotNull public @NotNull com.saicone.rtag.util.MC getMinimumVersion()
      Description copied from interface: ItemMirror
      Get the minimum compatible version, inclusive.
      Specified by:
      getMinimumVersion in interface ItemMirror
      Returns:
      a version.
    • upgrade

      public void upgrade(@NotNull @NotNull Object compound, @NotNull @NotNull String id, @NotNull @NotNull Object components, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to)
      Description copied from interface: ItemMirror
      Upgrade current item tag compound from lower version.
      Specified by:
      upgrade in interface ItemMirror
      Parameters:
      compound - the tag compound that represents item data.
      id - the item material id.
      components - the item components, on older versions this may be the item tag.
      from - the initial version of item data.
      to - the version to upgrade item data.
    • downgrade

      public void downgrade(@NotNull @NotNull Object compound, @NotNull @NotNull String id, @NotNull @NotNull Object components, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to)
      Description copied from interface: ItemMirror
      Downgrade current item tag compound from upper version.
      Specified by:
      downgrade in interface ItemMirror
      Parameters:
      compound - the tag compound that represents item data.
      id - the item material id.
      components - the item components, on older versions this may be the item tag.
      from - the initial version of item data.
      to - the version to downgrade item data.
    • processContent

      @Internal public void processContent(@NotNull @NotNull Object tag, @NotNull @NotNull com.saicone.rtag.util.MC from, @NotNull @NotNull com.saicone.rtag.util.MC to)
      Process current item content.
      Parameters:
      tag - the item components or tag as tag compound object.
      from - the initial version of item.
      to - the version to convert its contents.
    • processComponents

      @Deprecated(since="1.5.14", forRemoval=true) public void processComponents(@NotNull @NotNull Object components, float from, float to)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Process current item container components to convert items inside.
      Parameters:
      components - ItemStack components.
      from - Version specified in compound.
      to - Version to convert.