Sueta
RE

ReflectedNBTWrapper / NBT Wrapper lib using reflection

1.2

All version supported NBT Utility

·Plugin

ReflectedNBTWrapper is quite simple library.
It helps you use NBT on all version.
Of course, you can use your own NBT Data.

Custom NBT serializaion / deserializon is work in process.

Example - Create new NBTCompound

public static ReflectedNBTCompound createSimpleCompound(){
  ReflectedNBTCompound comp = new ReflectedNBTCompound();
  comp.setValue("TestValue",1);
  return comp;
}

Example - Import NBTCompound to Item

public static ItemStack importTag(ItemStack item){
  ReflectedNBTCompound comp = ItemNBTExtrator.extractOrCreateNBT(item);
  comp.setValue("TestValue",1);
  return ItemNBTImporter.importNBT(item,comp);
}

Example - Extract NBTCompound from Item

public static ReflectedNBTCompound extractAndTest(ItemStack item){
  ReflectedNBTCompound comp = ItemNBTExtrator.extractOrCreateNBT(item);
  ReflectedNBTInteger ref = comp.getValue("TestValue");
  if(ref.getValue() == 1)
     System.out.println("Read success");
  return comp;
}
Version list

1.1.0 Alpha

  • Change from extend(ReflectedNBTBase) to implements(IReflectedNBTBase)
  • Removed abstraction from ReflectedNBTBase
  • Change class file name from ReflectedNBTBase to ReflectedNBTStorage
  • Add unwrapping to ReflectedNBTList

1.1.1 Alpha

  • Added IReflectedNBTCompound#get(String)
  • Added IReflectedNBTCompound#getNBT(IReflectedNBTBase)
  • Added IReflectedNBTCompound#set(String,Object)
  • Added IReflectedNBTCompound#set(String,IReflectedNBTBase)
  • Change package name to v1_1R1

1.1.2 Alpha

  • Added ReflectedNBTCompound#keyset()
  • Now ReflectedNBTList implements Iterable
  • Added LinearIterator
  • Changed package name to v1_1_R2

1.1.3 Alpha

  • Changed IReflectedNBTCompound implemention to IReflectedNBTBase<HashMap<String,Object>>
  • Added IReflectedNBTBase#clear()
  • Added IReflectedNBTBase#collapse(IReflectedNBTBase)
  • Changed package name to v1_1R3

1.2 Release

  • Added Native to NBT Exchanger at ReflectedNBTStorage
  • Changed package name to v1_2
  • Version stabilized! Change version state to Release.

1.2.1 Release

  • Now ReflectedNBTStorage#createReflectedNBT(Object) returns parameter if it implements IReflectedNBTWrapper
  • Changed package name to v1_2R1

You can download releases with clicking version name.
Download or View source on my Github.

Similar projects

Plugin →