mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 16:55:12 +00:00
1.7.10 Files
Files added
This commit is contained in:
1 parent
393ea9b463
commit
a31efb2dc3
1768 files changed
+84831
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package noppes.npcs.controllers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
public class PlayerMailData{
|
||||
public ArrayList<PlayerMail> playermail = new ArrayList<PlayerMail>();
|
||||
|
||||
public void loadNBTData(NBTTagCompound compound) {
|
||||
ArrayList<PlayerMail> newmail = new ArrayList<PlayerMail>();
|
||||
NBTTagList list = compound.getTagList("MailData", 10);
|
||||
if(list == null)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++){
|
||||
PlayerMail mail = new PlayerMail();
|
||||
mail.readNBT(list.getCompoundTagAt(i));
|
||||
newmail.add(mail);
|
||||
}
|
||||
playermail = newmail;
|
||||
}
|
||||
|
||||
public NBTTagCompound saveNBTData(NBTTagCompound compound) {
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(PlayerMail mail : playermail){
|
||||
list.appendTag(mail.writeNBT());
|
||||
}
|
||||
|
||||
compound.setTag("MailData", list);
|
||||
return compound;
|
||||
}
|
||||
|
||||
public boolean hasMail() {
|
||||
for(PlayerMail mail : playermail)
|
||||
if(!mail.beenRead)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user