mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 16:59:43 +00:00
Added isGUIOpen() function, and setPosition function with a dimensionId parameter to ScriptPlayer.
This commit is contained in:
1 parent
27b88c1fce
commit
0d807b36d9
13 files changed
+84
-17
No files matched your search
@@ -39,10 +39,12 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
|
||||
public String playername = "";
|
||||
public String uuid = "";
|
||||
|
||||
|
||||
private EntityNPCInterface activeCompanion = null;
|
||||
public int companionID = 0;
|
||||
|
||||
public boolean isGUIOpen = false;
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound compound) {
|
||||
PlayerDataController.instance.savePlayerData(this);
|
||||
@@ -86,6 +88,7 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
player.worldObj.spawnEntityInWorld(npc);
|
||||
}
|
||||
}
|
||||
isGUIOpen = data.getBoolean("isGUIOpen");
|
||||
}
|
||||
public NBTTagCompound getNBT() {
|
||||
if(player != null){
|
||||
@@ -105,6 +108,7 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
compound.setString("PlayerName", playername);
|
||||
compound.setString("UUID", uuid);
|
||||
compound.setInteger("PlayerCompanionId", companionID);
|
||||
compound.setBoolean("isGUIOpen",isGUIOpen);
|
||||
|
||||
if(hasCompanion()){
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
@@ -118,7 +122,17 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
public void init(Entity entity, World world) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void setGUIOpen(boolean bool) {
|
||||
isGUIOpen = bool;
|
||||
saveNBTData(null);
|
||||
}
|
||||
|
||||
public boolean getGUIOpen() {
|
||||
loadNBTData(null);
|
||||
return isGUIOpen;
|
||||
}
|
||||
|
||||
public boolean hasCompanion(){
|
||||
return activeCompanion != null && !activeCompanion.isDead;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user