Skip to content

Commit 49821cc

Browse files
committed
Fix offline player inventory saving
1 parent 467fe0e commit 49821cc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/org/spongepowered/common/entity/player/SpongeUserInventory.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,23 @@ public ListTag writeList(final ListTag nbtTagListIn) {
139139
if (!this.mainInventory.get(i).isEmpty()) {
140140
final CompoundTag nbttagcompound = new CompoundTag();
141141
nbttagcompound.putByte("Slot", (byte) i);
142-
this.mainInventory.get(i).save(SpongeCommon.server().registryAccess(), nbttagcompound);
143-
nbtTagListIn.add(nbttagcompound);
142+
nbtTagListIn.add(this.mainInventory.get(i).save(SpongeCommon.server().registryAccess(), nbttagcompound));
144143
}
145144
}
146145

147146
for (int j = 0; j < this.armorInventory.size(); ++j) {
148147
if (!this.armorInventory.get(j).isEmpty()) {
149148
final CompoundTag nbttagcompound1 = new CompoundTag();
150149
nbttagcompound1.putByte("Slot", (byte) (j + 100));
151-
this.armorInventory.get(j).save(SpongeCommon.server().registryAccess(), nbttagcompound1);
152-
nbtTagListIn.add(nbttagcompound1);
150+
nbtTagListIn.add(this.armorInventory.get(j).save(SpongeCommon.server().registryAccess(), nbttagcompound1));
153151
}
154152
}
155153

156154
for (int k = 0; k < this.offHandInventory.size(); ++k) {
157155
if (!this.offHandInventory.get(k).isEmpty()) {
158156
final CompoundTag nbttagcompound2 = new CompoundTag();
159157
nbttagcompound2.putByte("Slot", (byte) (k + 150));
160-
this.offHandInventory.get(k).save(SpongeCommon.server().registryAccess(), nbttagcompound2);
161-
nbtTagListIn.add(nbttagcompound2);
158+
nbtTagListIn.add(this.offHandInventory.get(k).save(SpongeCommon.server().registryAccess(), nbttagcompound2));
162159
}
163160
}
164161

0 commit comments

Comments
 (0)