mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 03:47:27 +00:00
getTag() and hasTag() functions from ScriptItemStack no longer write the item stack NBT tag on call.
This commit is contained in:
1 parent
d74a1f2bee
commit
7808e4a433
1 file changed
+5
@@ -112,6 +112,8 @@ public class ScriptItemStack implements IItemStack {
|
||||
* @return Returns whether or not the key exists
|
||||
*/
|
||||
public boolean hasTag(String key){
|
||||
if(item.stackTagCompound == null)
|
||||
return false;
|
||||
return getTag().hasKey(key);
|
||||
}
|
||||
|
||||
@@ -120,6 +122,9 @@ public class ScriptItemStack implements IItemStack {
|
||||
* @return Returns the value associated with the key. Returns null of it doesnt exist
|
||||
*/
|
||||
public Object getTag(String key){
|
||||
if(item.stackTagCompound == null)
|
||||
return null;
|
||||
|
||||
NBTBase tag = getTag().getTag(key);
|
||||
if(tag == null)
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user