mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-24 21:04:27 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -19,16 +19,16 @@ public class Profile implements IProfile {
|
||||
|
||||
public Profile(EntityPlayer player, NBTTagCompound compound) {
|
||||
this.player = player;
|
||||
if(compound.hasKey("CurrentSlotId")){
|
||||
if (compound.hasKey("CurrentSlotId")) {
|
||||
this.currentSlotId = compound.getInteger("CurrentSlotId");
|
||||
} else {
|
||||
this.currentSlotId = 0;
|
||||
}
|
||||
|
||||
if(compound.hasKey("Slots")){
|
||||
if (compound.hasKey("Slots")) {
|
||||
NBTTagCompound slotsCompound = compound.getCompoundTag("Slots");
|
||||
Set<String> keys = slotsCompound.func_150296_c();
|
||||
for(String key : keys) {
|
||||
for (String key : keys) {
|
||||
try {
|
||||
int slotId = Integer.parseInt(key);
|
||||
NBTTagCompound slotNBT = slotsCompound.getCompoundTag(key);
|
||||
@@ -76,13 +76,13 @@ public class Profile implements IProfile {
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
if(player != null)
|
||||
if (player != null)
|
||||
compound.setString("Name", player.getCommandSenderName());
|
||||
compound.setInteger("CurrentSlotId", currentSlotId);
|
||||
NBTTagCompound slotsCompound = new NBTTagCompound();
|
||||
for(Map.Entry<Integer, ISlot> entry : slots.entrySet()) {
|
||||
for (Map.Entry<Integer, ISlot> entry : slots.entrySet()) {
|
||||
// Save only non-temporary slots.
|
||||
if(entry.getValue().isTemporary())
|
||||
if (entry.getValue().isTemporary())
|
||||
continue;
|
||||
slotsCompound.setTag(String.valueOf(entry.getKey()), entry.getValue().toNBT());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user