Rtag | API to edit block, entity, item NBT [1.8.8 - 1.21.4] icon

Rtag | API to edit block, entity, item NBT [1.8.8 - 1.21.4] -----

The "readable tag" library, an easy way to handle NBTTagCompounds and data components




Additions
  • Support for Minecraft 1.21.4.
  • Debug message for class id override on EasyLookup.
Changes
  • Now global registry is used when block entity doesn't exist on a world.
Bug Fixes
  • Fix null objects data component wrapped optional getter.
  • Fix incorrect copy method usage on non-mapped +1.20.5 servers.
----------, Dec 4, 2024

Additions
  • Support for Minecraft 1.21.2 and 1.21.3.
  • Component support on material mirror.
  • Attribute mirror to change item attributes names across versions.
  • saicone.easylookup.debug system property to print debug information about EasyLookup usage.
  • Support to legacy damageable items on material mirror.
Changes
  • Now ItemData version detector read stored enchantments and inner items recursively.
Bug Fixes
  • Fix some components not being upgraded by malformatted tags.
  • Fix compatibility with servers that change NBT field types.
  • Typo on book contents component.
  • RtagEntity attributes not being edited correctly.
----------, Oct 24, 2024

Additions
  • Added ComponentType#all() to get a view of all component types.
Bug Fixes
  • #9 (rtag-item): fix SkullTexture usage on 1.21.1 servers.
----------, Sep 18, 2024

Additions
  • Blazingly fast item edits!, now any RtagItem usage is practically invisible for server performance.
  • ItemObject#newCraftItem() to create CraftItemStack using ItemStack.
  • ItemObject#loadHandle() to explicitly load handle into ItemStack using a CraftItemStack mirror.
  • ItemObject#getCraftStack() to get delegated CraftItemStack from ItemStack object (Only for Paper +1.21).
  • ItemObject#getUncheckedHandle() to get handle from CraftItemStack unsafely.
  • ItemObject#asCraftMirror() to convert ItemStack to it's CraftItemStack form.
  • ItemData class dedicated to item data handling.
  • ItemData#getItemVersion() to get the nearest minecraft version from item by reading item data.
  • RtagItem#getLiteralTag() to get current item tag or null.
  • RtagItem#loadInto() to load changes into provided minecraft ItemStack.
  • Proper conversion for new component changes.
Changes
  • Now item changes are applied directly to items.
  • Avoid rtag plugin code remap on newer paper servers.
  • Now ItemObject#setHandle() replaces CraftItemStack handle directly or create a bukkit copy of provided handle to apply changes into item.
  • Most of deprecated methods are marked to deletion on 1.6.0 update.
  • Now ItemTagStream uses ItemData to detect item version from compound.
  • RtagItem now doesn't clone or create any tag unless you're trying to edit it.
  • RtagItem now allows to clear item tag.
Bug Fixes
  • Recursive reflection on EasyLookup doesn't detect some legacy fork patches.
  • Component mirror doesn't change enchantment sweeping into sweeping_edge (and vicerverse).
Deprecations
  • ItemObject#getComponentPath() and ItemObject#getTagPath(), use ItemData methods instead.
----------, Sep 3, 2024

Additions
  • Support for Minecraft 1.21.1.
  • OptionalType#asEnum() to get the current value as enum type.
  • Compatibility with Map values on IterableType.
  • More precise error messages when trying to create an invalid component type.
Bug Fixes
  • Fix component type not being parsed or encoded.
  • Fix IterableType iteration hover arrays and single objects.
----------, Jul 8, 2024

Additions
  • Support for Minecraft 1.21.
Bug Fixes
  • Fix skull texture usage on servers with newer versions of authlib.
----------, Jun 13, 2024

Additions
  • More precise ServerInstance#DATA_VERSION for newer server versions.
Bug Fixes
  • #7 (rtag-item): fix ItemObject#getCustomDataTag() on 1.20.6 servers.
  • Fix enchantment tag initialization.
----------, Apr 30, 2024

Additions
  • Support for Minecraft 1.20.6 (same has 1.20.5).
  • Item count conversion.
  • Profile component transformation.
  • Profile/SkullOwner sub-paths conversion.
Changes
  • Now component conversion doesn't replace components object.
Bug Fixes
  • Fix component paths not being downgraded.
  • Fix enchantment level upgrade to component format.
  • Fix potion convertion.
  • Fix item effects conversion.
  • Fix firework component transformation.
----------, Apr 30, 2024

Additions
  • Experimental enchantments on EnchantmentTag from Minecraft 1.21.
Changes
  • Now EnchantmentTag use enchantment registry to get bukkit enchantments on newer Minecraft versions.
Bug Fixes
  • Several reflected methods on +1.20.5 Mojang mapped servers.
----------, Apr 28, 2024

Minecraft 1.20.5 change ItemStack format, in order to keep Rtag in continuous development, the next updates will have multiple experimental features

It's not suggested to use any experimental change/addition unless you are shading the library in your project

Additions
  • Support for Minecraft 1.20.5.
  • Multiple removal notices in deprecated methods.
  • ItemObject#hasCustomData() to check if item has custom data (or tag for <1.20.5).
  • ItemObject#apply() to apply data updates into item (or load compound for <1.20.5).
  • ItemObject#copy() to copy the provided item.
  • ItemObject#getCustomDataTag() and ItemObject#setCustomDataTag() to get tag from custom data component inside item.
  • ItemObject#getComponentPath() to convert any old tag path into new component path.
  • ItemObject#getTagPath() to convert any new component path into any old tag path.
  • ItemTagStream#ofVersion() to create an ItemTagStream instance with a provided version range.
  • IContainerMirror instance to convert any item inside container on it's item form.
  • TagCompound#newUncheckedTag() and TagList#newUncheckedTag() to create a new tag without check provided object.
  • (experimental) Rtag#UNIT constant to get a Minecraft unit object.
  • (experimental) Rtag#getMinecraftRegistry method to get a custom registry provided by Bukkit.
  • (experimental) RtagItem#getComponents() method to get component map from MC item (only for +1.20.5).
  • (experimental) IComponentMirror instance to convert item tags into components and viceversa to mantain cross-version support on ItemTagStream.
  • (experimental) DataComponent utility class to manage any data Holder, Map and Patch instances.
  • (experimental) ComponentType utility class to get, parse, encode and handle any data component type and object.
  • (experimental) Multiple methods to get/edit/set data components using RtagItem instance.

Changes
  • ServerInstance utility class has been fully recoded.
  • TagCompound.DATA usage will be moved to TStream.COMPOUND.
  • Any #edit() method from RtagEditor instances has been moved into RtagEditor directly.
  • Any Enchantment usage from RtagItem on +1.20.5 servers will be redirected to Bukkit API (since items now cannot hold invalid enchantments).
  • RtagItem#fixSerialization() will make no change on +1.20.5 since items now use different serialization.
  • ItemMirror instance now use item components has main conversion concept (on versions before 1.20.5 the components object will be item tag).
  • ItemTagStream now make a fully usage of instance version to handle tags and also use item components on newer versions.
  • EasyLookup#field() is now a public method.

Deprecations
  • Any HideFlag usage from RtagItem since items cannot have flags on +1.20.5.
  • ItemObject#load() since items now cannot implement direct updates from compound (and also is really messy to mantain on newer versions).
  • ItemObject#getTag() and ItemObject#setTag() since items now use custom data component.
  • IShulkerMirror instance since IContainerMirror now is used to convert containers.
----------, Apr 24, 2024

Additions
  • Support for Minecraft 1.20.3 and 1.20.4.
  • Backwards list index using negative numbers, for example -1 to get the lastest value.
Bug Fixes
  • Fix skull meta profile setter.
----------, Dec 6, 2023

Additions
  • Support for servers without CraftBukkit relocation (see PaperMC announce).
  • Support for null tag on items.
Removed
  • Some unused checks in ItemObject.
----------, Oct 30, 2023

Additions
  • Old methods from EasyLookup class to avoid API breaks.
Bug Fixes
  • Fix chat component conversion between empty (json) strings.
----------, Sep 24, 2023

Additions
  • Support for Minecraft 1.20.2.
  • Support for mojang mapped servers.
  • Explicit number conversion for OptionalType.
Bug Fixes
  • Fix failed value conversion not being deleted from OptionalType#asCollection()
Changes
  • Item mirror instances now use floats for version comparision (better acurracy for material conversion between MC minor releases).
----------, Sep 23, 2023

Additions
  • EnchantmentTag#getEnchantment() to get Bukkit equivalent enchantment if exists.
  • ItemStack callback from SkullTexture to process the retrieved textured skull if it's obtained with player name or uuid.
  • RtagEntity#getAttributeValue() to get attribute values.
  • Pretty NBT formatter to get any NBT object as pretty string, json or component, you can also use a custom color palette.
  • Compatibility with any type of NBT object on TStreamTools operations (Using GZIP format or not).
  • TStream instances now can read any type of serialized object as bytes (useful to read objects from Base64 that use different serialization formats).
  • ItemTagStream instances now detect PaperMC serialized items to convert across versions.
  • Multiple methods to convert Minecraft data versions using ServerInstance class.
  • OptionalType#first() to get the first object from OptionalType (list, array or single object).
  • OptionalType#single() to get the OptionalType as single object instance.
  • #merge() and #deepMerge() methods to merge multiple paths into compounds.
  • #move() method to move an object from path to any path using Rtag or RtagEditor instances.
  • TagBase#size() and TagBase#clear() to handle any list or compound.
Bug Fixes
  • Fix RtagItem#addEnchantment() not saving enchantments properly.
Changes
  • The documentation is now instantly updated when new version is published.
  • RtagEditor#load() method returns the current type object.
  • The textured skulls from SkullTexture now are unique ItemStack objects.
  • Texture values from SkullTexture now are cached as String (less memory usage).
  • The plugin is now marked as Folia supported.
----------, Aug 25, 2023

Additions
  • Support for Minecraft 1.20 and 1.20.1.
----------, Jun 7, 2023

Additions
  • OptionalType#clear() to clear current object type (Map or Collection).
  • RtagItem#fixSerialization() to fix bad item caused by Bukkit serialization.
Bug Fixes
  • #1 (main): fix RtagEditor#get() conversion to Map of objects.
Changes
  • Now OptionalType uses less specific conversion, like OptionalType#asCollection().
----------, May 16, 2023

Additions
  • Support for Minecraft 1.19.4.
  • Functional methods on RtagEditor instances to handle tags more easily.
  • Compatibility methods on RtagEditor instances like RtagItem#addEnchantment or RtagEntity#setAttributeBase.
  • Explicit conversion methods using OptionalType from #getOptional().
  • Support to save UUIDs and any object as tag without serializer.
  • Recursive search for reflected methods, so unreflection was removed for better readability.
  • Methods to handle EnchantmentTag enum.
  • TagList#setValue() and TagCompound#setValue() to override the actual value.
  • TagCompound#clear() to clear the provided NBTTagCompound tag.
  • Methods to check object instance on BlockObject, EntityObject, ItemObject and ChatComponent class.
  • NBT String and Map of objects support inside TStream instances.
  • Readable Map support inside ItemTagStream (Make item name and lore readable and viceversa).
Changes
  • Now all the reflection usage throws unchecked exceptions.
  • General optimization for tag methods.
  • Now OptionalType can be iterated using for statement.
----------, Apr 18, 2023

Additions
  • Support for Minecraft 1.19.3.
  • ItemMaterialTag#getValidMaterial() method to get valid material id for current server version.
Bug Fixes
  • Fix reflected methods in 1.17 servers.
----------, Dec 9, 2022

Additions
  • Support for Minecraft 1.19.
  • TagBase#getTypeId(Object) method to get NBT object ID.
  • Boolean object compatibility.
  • Support for player name and UUID in SkullTexture#getTexturedHead(String).
  • TagList#getValue() method to get the NBTBase list inside NBTTagList.
  • TagList#contains() method to check the existence of NBTBase inside NBTTagList.
  • TagList#clone() & TagBase#clone() method for tags.
  • RtagMirror#clone() method to clone any NBT object type.
  • String compatibility to construct NBTTagCompound via TagCompound#newTag(String) method.
  • TagCompound#getJson() method to get NBTTagCompound as JSON String.
Changes
  • TagList now can be created with any type List.
  • TagCompound#set() now return the added value.
  • Rtag now extends RtagMirror.
  • TagCompound#newTag() & TagList#newTag() now requires RtagMirror instance instead of Rtag.
Breaking Changes
  • TileBridge & TileTag classes was merged into BlockObject class.
  • EntityBridge & EntityTag classes was merged into EntityObject class.
  • ItemBridge & ItemTag classes was merged into ItemObject class.
----------, Jun 9, 2022

  • RtagEditor now have a safe option to get values with #getOptional().
    Code (Java):
    RtagItem tag = new RtagItem (item ) ;
    // Get value from "deep.path" or 32 if not exist
    int intValue = tag. getOptional ( "deep", "path" ). or ( 32 ) ;
----------, Mar 17, 2022

  • Creating deep paths is now avoided when Rtag tries to remove a value.
  • RtagEditor and its instances (RtagItem, RtagBlock, RtagEntity) now have #hasTag() method to check the existence of root or deep path value.
----------, Mar 15, 2022

  • Now RtagPlugin load all reflected methods when server starts.
----------, Mar 14, 2022

Resource Information
Author:
----------
Total Downloads: 3,560
First Release: Mar 14, 2022
Last Update: Dec 4, 2024
Category: ---------------
All-Time Rating:
6 ratings
Find more info at docs.saicone.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings