Added ScriptBlock and ScriptNbt support to scripting API

This commit is contained in:
luisc committed 2021-10-12 03:23:56 -05:00
1 parent 6752f8baec
commit 699182f4c0
9 files changed
+339 -4

No files matched your search

@@ -199,6 +199,21 @@ public class ScriptItemStack implements IItemStack {
return true;
}
public INbt getNbt() {
NBTTagCompound compound = this.item.getTagCompound();
if(compound == null) {
this.item.setTagCompound(compound = new NBTTagCompound());
}
return NpcAPI.Instance().getINbt(compound);
}
public INbt getItemNbt() {
NBTTagCompound compound = new NBTTagCompound();
this.item.writeToNBT(compound);
return NpcAPI.Instance().getINbt(compound);
}
/**
* No support is given for this method. Dont use if you dont know what you are doing.
* @return Minecraft ItemStack