mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 04:05:12 +00:00
Full Imports and Code Format Optimization
This commit is contained in:
1 parent
250edf099c
commit
6815f579a7
1192 files changed
+60344
-62167
No files matched your search
@@ -7,50 +7,49 @@ import noppes.npcs.api.handler.IPlayerDialogData;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class PlayerDialogData implements IPlayerDialogData {
|
||||
private final PlayerData parent;
|
||||
public HashSet<Integer> dialogsRead = new HashSet<Integer>();
|
||||
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>();
|
||||
if(compound == null)
|
||||
return;
|
||||
public PlayerDialogData(PlayerData parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public void loadNBTData(NBTTagCompound compound) {
|
||||
HashSet<Integer> dialogsRead = new HashSet<Integer>();
|
||||
if (compound == null)
|
||||
return;
|
||||
NBTTagList list = compound.getTagList("DialogData", 10);
|
||||
if(list == null){
|
||||
return;
|
||||
if (list == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTTagCompound nbttagcompound = list.getCompoundTagAt(i);
|
||||
dialogsRead.add(nbttagcompound.getInteger("Dialog"));
|
||||
}
|
||||
this.dialogsRead = dialogsRead;
|
||||
}
|
||||
}
|
||||
|
||||
public void saveNBTData(NBTTagCompound compound) {
|
||||
NBTTagList list = new NBTTagList();
|
||||
for(int dia : dialogsRead){
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
nbttagcompound.setInteger("Dialog", dia);
|
||||
list.appendTag(nbttagcompound);
|
||||
}
|
||||
|
||||
compound.setTag("DialogData", list);
|
||||
}
|
||||
public void saveNBTData(NBTTagCompound compound) {
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (int dia : dialogsRead) {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
nbttagcompound.setInteger("Dialog", dia);
|
||||
list.appendTag(nbttagcompound);
|
||||
}
|
||||
|
||||
public boolean hasReadDialog(int id) {
|
||||
return dialogsRead.contains(id);
|
||||
}
|
||||
compound.setTag("DialogData", list);
|
||||
}
|
||||
|
||||
public void readDialog(int id) {
|
||||
dialogsRead.add(id);
|
||||
}
|
||||
public boolean hasReadDialog(int id) {
|
||||
return dialogsRead.contains(id);
|
||||
}
|
||||
|
||||
public void unreadDialog(int id) {
|
||||
dialogsRead.remove(id);
|
||||
}
|
||||
public void readDialog(int id) {
|
||||
dialogsRead.add(id);
|
||||
}
|
||||
|
||||
public void unreadDialog(int id) {
|
||||
dialogsRead.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user