mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-27 14:22:56 +00:00
Profile Implementations
This commit is contained in:
1 parent
8ed86f5ec7
commit
2ebe4ed9c5
11 files changed
+769
-114
No files matched your search
@@ -8,56 +8,59 @@ public class Slot {
|
||||
private String name;
|
||||
private long lastLoaded;
|
||||
private NBTTagCompound compound;
|
||||
private boolean temporary = false;
|
||||
|
||||
public Slot(int id, String name) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Slot(int id, String name, NBTTagCompound compound, long last) {
|
||||
public Slot(int id, String name, NBTTagCompound compound, long last, boolean temporary) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.compound = compound;
|
||||
this.lastLoaded = last;
|
||||
this.temporary = temporary;
|
||||
}
|
||||
|
||||
// Getters and setters
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public long getLastLoaded() {
|
||||
return lastLoaded;
|
||||
}
|
||||
|
||||
public void setLastLoaded(long lastLoaded) {
|
||||
this.lastLoaded = lastLoaded;
|
||||
}
|
||||
|
||||
public NBTTagCompound getCompound() {
|
||||
return compound;
|
||||
}
|
||||
|
||||
public void setCompound(NBTTagCompound compound) {
|
||||
this.compound = compound;
|
||||
}
|
||||
public boolean isTemporary() {
|
||||
return temporary;
|
||||
}
|
||||
public void setTemporary(boolean temporary) {
|
||||
this.temporary = temporary;
|
||||
}
|
||||
|
||||
public NBTTagCompound toNBT() {
|
||||
NBTTagCompound slotNBT = new NBTTagCompound();
|
||||
slotNBT.setString("Name", name);
|
||||
slotNBT.setLong("LastLoaded", lastLoaded);
|
||||
slotNBT.setTag("Data", compound);
|
||||
slotNBT.setBoolean("Temporary", temporary);
|
||||
return slotNBT;
|
||||
}
|
||||
|
||||
@@ -65,6 +68,7 @@ public class Slot {
|
||||
String name = slotNBT.getString("Name");
|
||||
long lastLoaded = slotNBT.getLong("LastLoaded");
|
||||
NBTTagCompound compound = slotNBT.getCompoundTag("Data");
|
||||
return new Slot(id, name, compound, lastLoaded);
|
||||
boolean temporary = slotNBT.hasKey("Temporary") && slotNBT.getBoolean("Temporary");
|
||||
return new Slot(id, name, compound, lastLoaded, temporary);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user