mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 04:05:12 +00:00
API Changes:
-Implemented interfaces for all jobs & roles. ScriptPlayer: -Added getData() function, which returns player data objects. IPlayerData: New class that holds all player data for modification. -Holds dialog, bank, quest, transport, faction, item giver, and mail data. -Also holds companion data, with functions has/set/getCompanion, and a getCompanionID function to differentiate companions.
This commit is contained in:
1 parent
587f63396f
commit
63a1525ee2
66 files changed
+1418
-207
No files matched your search
@@ -15,19 +15,23 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.data.DataSkinOverlays;
|
||||
import noppes.npcs.entity.data.DataTimers;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.interfaces.entity.ICustomNpc;
|
||||
import noppes.npcs.scripted.interfaces.handler.*;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
public class PlayerData implements IExtendedEntityProperties{
|
||||
public PlayerDialogData dialogData = new PlayerDialogData();
|
||||
public PlayerBankData bankData = new PlayerBankData();
|
||||
public PlayerQuestData questData = new PlayerQuestData();
|
||||
public PlayerTransportData transportData = new PlayerTransportData();
|
||||
public PlayerFactionData factionData = new PlayerFactionData();
|
||||
public PlayerItemGiverData itemgiverData = new PlayerItemGiverData();
|
||||
public PlayerMailData mailData = new PlayerMailData();
|
||||
public class PlayerData implements IExtendedEntityProperties, IPlayerData {
|
||||
public PlayerDialogData dialogData = new PlayerDialogData(this);
|
||||
public PlayerBankData bankData = new PlayerBankData(this);
|
||||
public PlayerQuestData questData = new PlayerQuestData(this);
|
||||
public PlayerTransportData transportData = new PlayerTransportData(this);
|
||||
public PlayerFactionData factionData = new PlayerFactionData(this);
|
||||
public PlayerItemGiverData itemgiverData = new PlayerItemGiverData(this);
|
||||
public PlayerMailData mailData = new PlayerMailData(this);
|
||||
|
||||
public DataTimers timers = new DataTimers(this);
|
||||
public DataSkinOverlays skinOverlays = new DataSkinOverlays(this);
|
||||
|
||||
@@ -245,4 +249,48 @@ public class PlayerData implements IExtendedEntityProperties{
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCompanion(ICustomNpc npc) {
|
||||
this.setCompanion((EntityNPCInterface) npc.getMCEntity());
|
||||
}
|
||||
|
||||
public ICustomNpc getCompanion() {
|
||||
return (ICustomNpc) NpcAPI.Instance().getIEntity(activeCompanion);
|
||||
}
|
||||
|
||||
public int getCompanionID() {
|
||||
return companionID;
|
||||
}
|
||||
|
||||
public IPlayerDialogData getDialogData() {
|
||||
return dialogData;
|
||||
}
|
||||
|
||||
public IPlayerBankData getBankData() {
|
||||
return bankData;
|
||||
}
|
||||
|
||||
public IPlayerQuestData getQuestData() {
|
||||
return questData;
|
||||
}
|
||||
|
||||
public IPlayerTransportData getTransportData() {
|
||||
return transportData;
|
||||
}
|
||||
|
||||
public IPlayerFactionData getFactionData() {
|
||||
return factionData;
|
||||
}
|
||||
|
||||
public IPlayerItemGiverData getItemGiverData() {
|
||||
return itemgiverData;
|
||||
}
|
||||
|
||||
public IPlayerMailData getMailData() {
|
||||
return mailData;
|
||||
}
|
||||
|
||||
public void save() {
|
||||
PlayerDataController.instance.savePlayerData(this);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user