3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00

Fix NPE in mob spawner blocks on non-bukkit implementations

Dieser Commit ist enthalten in:
wizjany 2013-03-17 22:11:29 -04:00
Ursprung 2e8119bdb1
Commit 422cba101d

Datei anzeigen

@ -147,8 +147,8 @@ public class MobSpawnerBlock extends BaseBlock implements TileEntityBlock {
values.put("MaxSpawnDelay", new ShortTag("MaxSpawnDelay", maxSpawnDelay));
values.put("MaxNearbyEntities", new ShortTag("MaxNearbyEntities", maxNearbyEntities));
values.put("RequiredPlayerRange", new ShortTag("RequiredPlayerRange", requiredPlayerRange));
values.put("SpawnData", new CompoundTag("SpawnData", spawnData.getValue()));
values.put("SpawnPotentials", new ListTag("SpawnPotentials", CompoundTag.class, spawnPotentials.getValue()));
values.put("SpawnData", new CompoundTag("SpawnData", spawnData == null ? null : spawnData.getValue()));
values.put("SpawnPotentials", new ListTag("SpawnPotentials", CompoundTag.class, spawnPotentials == null ? null : spawnPotentials.getValue()));
return new CompoundTag(getNbtId(), values);
}
@ -192,14 +192,14 @@ public class MobSpawnerBlock extends BaseBlock implements TileEntityBlock {
} catch (InvalidFormatException e) { // leave tag as null, handle later
}
this.spawnCount = spawnCountTag.getValue();
this.spawnRange = spawnRangeTag.getValue();
this.minSpawnDelay = minSpawnDelayTag.getValue();
this.maxSpawnDelay = maxSpawnDelayTag.getValue();
this.maxNearbyEntities = maxNearbyEntitiesTag.getValue();
this.requiredPlayerRange = requiredPlayerRangeTag.getValue();
this.spawnPotentials = new ListTag("SpawnPotentials", CompoundTag.class, spawnPotentialsTag.getValue());
this.spawnData = new CompoundTag("SpawnData", spawnDataTag.getValue());
this.spawnCount = spawnCountTag == null ? null : spawnCountTag.getValue();
this.spawnRange = spawnRangeTag == null ? null : spawnRangeTag.getValue();
this.minSpawnDelay = minSpawnDelayTag == null ? null : minSpawnDelayTag.getValue();
this.maxSpawnDelay = maxSpawnDelayTag == null ? null : maxSpawnDelayTag.getValue();
this.maxNearbyEntities = maxNearbyEntitiesTag == null ? null : maxNearbyEntitiesTag.getValue();
this.requiredPlayerRange = requiredPlayerRangeTag == null ? null : requiredPlayerRangeTag.getValue();
this.spawnPotentials = new ListTag("SpawnPotentials", CompoundTag.class, spawnPotentialsTag == null ? null : spawnPotentialsTag.getValue());
this.spawnData = new CompoundTag("SpawnData", spawnDataTag == null ? null : spawnDataTag.getValue());
}
}