mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 18:54:53 +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
@@ -4,9 +4,15 @@ import java.util.HashSet;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.scripted.interfaces.handler.IPlayerDialogData;
|
||||
|
||||
public class PlayerDialogData{
|
||||
public class PlayerDialogData implements IPlayerDialogData {
|
||||
private final PlayerData parent;
|
||||
public HashSet<Integer> dialogsRead = new HashSet<Integer>();
|
||||
|
||||
public PlayerDialogData(PlayerData parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void loadNBTData(NBTTagCompound compound) {
|
||||
HashSet<Integer> dialogsRead = new HashSet<Integer>();
|
||||
@@ -35,5 +41,16 @@ public class PlayerDialogData{
|
||||
|
||||
compound.setTag("DialogData", list);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasReadDialog(int id) {
|
||||
return dialogsRead.contains(id);
|
||||
}
|
||||
|
||||
public void readDialog(int id) {
|
||||
dialogsRead.add(id);
|
||||
}
|
||||
|
||||
public void unreadDialog(int id) {
|
||||
dialogsRead.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user