mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 09:34:46 +00:00
IEntity & IWorld:
-Added getStoredDataKeys() & getTempDataKeys() functions.
This commit is contained in:
1 parent
5e8c234ac7
commit
7d4a59d45a
2 files changed
+21
No files matched your search
@@ -744,6 +744,10 @@ public class ScriptWorld implements IWorld {
|
||||
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
|
||||
@@ -796,6 +800,14 @@ public class ScriptWorld implements IWorld {
|
||||
ScriptController.Instance.shouldSave = true;
|
||||
}
|
||||
|
||||
public String[] getStoredDataKeys() {
|
||||
NBTTagCompound compound = ScriptController.Instance.compound;
|
||||
if (compound != null) {
|
||||
return (String[]) compound.func_150296_c().toArray();
|
||||
}
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param x Position x
|
||||
* @param y Position y
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user