IEntity & IWorld:

-Added getStoredDataKeys() & getTempDataKeys() functions.
This commit is contained in:
Luis C.M committed 2022-12-27 16:46:59 -06:00
1 parent 5e8c234ac7
commit 7d4a59d45a
2 files changed
+21

No files matched your search

@@ -511,6 +511,10 @@ public class ScriptEntity<T extends Entity> implements IEntity {
tempData.clear();
}
public String[] getTempDataKeys() {
return tempData.keySet().toArray(new String[0]);
}
/**
* @param key The key of the data to be returned
* @return Returns the stored data
@@ -572,6 +576,11 @@ public class ScriptEntity<T extends Entity> implements IEntity {
entity.getEntityData().removeTag("CNPCStoredData");
}
public String[] getStoredDataKeys() {
NBTTagCompound compound = getStoredCompound();
return (String[]) compound.func_150296_c().toArray();
}
private NBTTagCompound getStoredCompound(){
NBTTagCompound compound = entity.getEntityData().getCompoundTag("CNPCStoredData");
if(compound == null)