for (int i = 0; i < args.size() - 1; i += 2)
{
CustomObject object = getHolder().worldConfig.worldObjects.parseCustomObject(args.get(i));
if (object == null || !object.canSpawnAsObject())
{
throw new InvalidConfigException("No custom object found with the name " + args.get(i));
}
if (!(object instanceof StructuredCustomObject) || ((StructuredCustomObject) object).getBranches(Rotation.NORTH).length == 0)
{
throw new InvalidConfigException("The object " + args.get(i) + " isn't a structure");
}
objects.add((StructuredCustomObject) object);
objectNames.add(args.get(i));
objectChances.add(readRarity(args.get(i + 1)));
}
// Inject ourselves in the BiomeConfig
if (getHolder().structureGen != null)
{
throw new InvalidConfigException("There can only be one CustomStructure resource in each BiomeConfig");
}
getHolder().structureGen = this;
}