mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Fixed issue with chests failing to save to a schematic due to a NullPointerException.
This commit is contained in:
parent
59afcce512
commit
24434e3e6f
@ -105,6 +105,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock {
|
|||||||
List<Tag> itemsList = new ArrayList<Tag>();
|
List<Tag> itemsList = new ArrayList<Tag>();
|
||||||
for (int i = 0; i < items.length; i++) {
|
for (int i = 0; i < items.length; i++) {
|
||||||
BaseItemStack item = items[i];
|
BaseItemStack item = items[i];
|
||||||
|
if (item != null) {
|
||||||
Map<String,Tag> data = new HashMap<String,Tag>();
|
Map<String,Tag> data = new HashMap<String,Tag>();
|
||||||
CompoundTag itemTag = new CompoundTag("Items", data);
|
CompoundTag itemTag = new CompoundTag("Items", data);
|
||||||
data.put("id", new ShortTag("id", item.getID()));
|
data.put("id", new ShortTag("id", item.getID()));
|
||||||
@ -113,6 +114,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock {
|
|||||||
data.put("Slot", new ByteTag("Slot", (byte)i));
|
data.put("Slot", new ByteTag("Slot", (byte)i));
|
||||||
itemsList.add(itemTag);
|
itemsList.add(itemTag);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Map<String,Tag> values = new HashMap<String,Tag>();
|
Map<String,Tag> values = new HashMap<String,Tag>();
|
||||||
values.put("Items", new ListTag("Items", CompoundTag.class, itemsList));
|
values.put("Items", new ListTag("Items", CompoundTag.class, itemsList));
|
||||||
return values;
|
return values;
|
||||||
|
Loading…
Reference in New Issue
Block a user