Improved XML validation

- XML schema has a proper namespace now
- line number in parsing error messages
- celestial object borders are validated too
- celestial object validation only crash after reporting all issues
This commit is contained in:
LemADEC 2017-06-26 00:37:45 +02:00
parent f65879eb8d
commit 6fc9735da9
12 changed files with 179 additions and 111 deletions

View file

@ -61,8 +61,51 @@ public class CelestialObjectManager extends XmlFileManager {
} }
// check overlapping regions // check overlapping regions
int countErrors = 0;
for (CelestialObject celestialObject1 : celestialObjects) { for (CelestialObject celestialObject1 : celestialObjects) {
celestialObject1.lateUpdate(); celestialObject1.lateUpdate();
// validate coordinates
if (!celestialObject1.isVirtual) {
if (celestialObject1.parentDimensionId != celestialObject1.dimensionId) {// not hyperspace
final CelestialObject celestialObjectParent = get(celestialObject1.parentGroup, celestialObject1.parentName);
if (celestialObjectParent == null) {
countErrors++;
WarpDrive.logger.error(String.format("Validation error #%d\nCelestial object %s refers to unknown parent %s:%s",
countErrors,
celestialObject1.getFullName(),
celestialObject1.parentGroup, celestialObject1.parentName ));
} else if ( celestialObject1.parentCenterX - celestialObject1.borderRadiusX < celestialObjectParent.dimensionCenterX - celestialObjectParent.borderRadiusX
|| celestialObject1.parentCenterZ - celestialObject1.borderRadiusZ < celestialObjectParent.dimensionCenterZ - celestialObjectParent.borderRadiusZ
|| celestialObject1.parentCenterX + celestialObject1.borderRadiusX > celestialObjectParent.dimensionCenterX + celestialObjectParent.borderRadiusX
|| celestialObject1.parentCenterZ + celestialObject1.borderRadiusZ > celestialObjectParent.dimensionCenterZ + celestialObjectParent.borderRadiusZ) {
countErrors++;
WarpDrive.logger.error(String.format("Validation error #%d\nCelestial object %s is outside its parent border.\n%s\n%s\n%s's area in parent %s is outside %s's border %s",
countErrors,
celestialObject1.getFullName(),
celestialObject1,
celestialObjectParent,
celestialObject1.getFullName(),
celestialObject1.getAreaInParent(),
celestialObjectParent.getFullName(),
celestialObjectParent.getWorldBorderArea() ));
}
}
if ( celestialObject1.dimensionCenterX - celestialObject1.borderRadiusX < -30000000
|| celestialObject1.dimensionCenterZ - celestialObject1.borderRadiusZ < -30000000
|| celestialObject1.dimensionCenterX + celestialObject1.borderRadiusX >= 30000000
|| celestialObject1.dimensionCenterZ + celestialObject1.borderRadiusZ >= 30000000 ) {
countErrors++;
WarpDrive.logger.error(String.format("Validation error #%d\nCelestial object %s is outside the game border +/-30000000.\n%s\n%s border is %s",
countErrors,
celestialObject1.getFullName(),
celestialObject1,
celestialObject1.getFullName(),
celestialObject1.getWorldBorderArea() ));
}
}
// validate against other celestial objects
for (CelestialObject celestialObject2 : celestialObjects) { for (CelestialObject celestialObject2 : celestialObjects) {
if (celestialObject1 == celestialObject2) { if (celestialObject1 == celestialObject2) {
continue; continue;
@ -72,30 +115,46 @@ public class CelestialObjectManager extends XmlFileManager {
final AxisAlignedBB areaInParent1 = celestialObject1.getAreaInParent(); final AxisAlignedBB areaInParent1 = celestialObject1.getAreaInParent();
final AxisAlignedBB areaInParent2 = celestialObject2.getAreaInParent(); final AxisAlignedBB areaInParent2 = celestialObject2.getAreaInParent();
if (areaInParent1.intersectsWith(areaInParent2)) { if (areaInParent1.intersectsWith(areaInParent2)) {
WarpDrive.logger.error("Overlapping parent areas detected " + celestialObject1.parentDimensionId); countErrors++;
WarpDrive.logger.error("Celestial object 1 is " + celestialObject1 + " with area " + areaInParent1); WarpDrive.logger.error(String.format("Validation error #%d\nOverlapping parent areas detected in dimension %d between %s and %s\nArea1 %s from %s\nArea2 %s from %s",
WarpDrive.logger.error("Celestial object 2 is " + celestialObject2 + " with area " + areaInParent2); countErrors,
throw new RuntimeException(String.format( celestialObject1.parentDimensionId,
"Invalid celestial objects definition:\n %s\nand\n %s\nare overlapping each others. Update your configuration to fix it.", celestialObject1.getFullName(),
celestialObject1.toString(), celestialObject2.toString())); celestialObject2.getFullName(),
areaInParent1,
celestialObject1,
areaInParent2,
celestialObject2 ));
} }
} }
// are they in the same dimension? // are they in the same dimension?
if (!celestialObject1.isVirtual && !celestialObject2.isVirtual && celestialObject1.dimensionId == celestialObject2.dimensionId) { if (!celestialObject1.isVirtual && !celestialObject2.isVirtual && celestialObject1.dimensionId == celestialObject2.dimensionId) {
final AxisAlignedBB areaToReachParent1 = celestialObject1.getAreaToReachParent(); final AxisAlignedBB worldBorderArea1 = celestialObject1.getWorldBorderArea();
final AxisAlignedBB areaToReachParent2 = celestialObject2.getAreaToReachParent(); final AxisAlignedBB worldBorderArea2 = celestialObject2.getWorldBorderArea();
if (areaToReachParent1.intersectsWith(areaToReachParent2)) { if (worldBorderArea1.intersectsWith(worldBorderArea2)) {
WarpDrive.logger.error("Overlapping areas detected in dimension " + celestialObject1.dimensionId); countErrors++;
WarpDrive.logger.error("Celestial object 1 is " + celestialObject1 + " with area " + areaToReachParent1); WarpDrive.logger.error(String.format("Validation error #%d\nOverlapping areas detected in dimension %d between %s and %s\nArea1 %s from %s\nArea2 %s from %s",
WarpDrive.logger.error("Celestial object 2 is " + celestialObject2 + " with area " + areaToReachParent2); countErrors,
celestialObject1.dimensionId,
celestialObject1.getFullName(),
celestialObject2.getFullName(),
worldBorderArea1,
celestialObject1,
worldBorderArea2,
celestialObject2 ));
}
}
}
}
if (countErrors == 1) {
throw new RuntimeException("Invalid celestial objects definition: update your configuration to fix this validation error, see logs for details.");
} else if (countErrors > 0) {
throw new RuntimeException(String.format( throw new RuntimeException(String.format(
"Invalid celestial objects definition:\n %s\nand\n %s\nare overlapping each others. Update your configuration to fix it.", "Invalid celestial objects definition: update your configuration to fix those %d validation errors, see logs for details.",
celestialObject1.toString(), celestialObject2.toString())); countErrors));
}
}
}
} }
// We're not checking invalid dimension id, so they can be pre-allocated (see MystCraft) // We're not checking invalid dimension id, so they can be pre-allocated (see MystCraft)
} }

View file

@ -1012,19 +1012,26 @@ public class WarpDriveConfig {
ErrorHandler xmlErrorHandler = new ErrorHandler() { ErrorHandler xmlErrorHandler = new ErrorHandler() {
@Override @Override
public void warning(SAXParseException exception) throws SAXException { public void warning(SAXParseException exception) throws SAXException {
WarpDrive.logger.warn("XML warning: " + exception.getLocalizedMessage()); WarpDrive.logger.warn(String.format("XML warning at line %d: %s",
exception.getLineNumber(),
exception.getLocalizedMessage() ));
// exception.printStackTrace(); // exception.printStackTrace();
} }
@Override @Override
public void fatalError(SAXParseException exception) throws SAXException { public void fatalError(SAXParseException exception) throws SAXException {
WarpDrive.logger.warn("XML fatal error: " + exception.getLocalizedMessage()); WarpDrive.logger.warn(String.format("XML fatal error at line %d: %s",
exception.getLineNumber(),
exception.getLocalizedMessage() ));
// exception.printStackTrace(); // exception.printStackTrace();
} }
@Override @Override
public void error(SAXParseException exception) throws SAXException { public void error(SAXParseException exception) throws SAXException {
WarpDrive.logger.warn("XML error: " + exception.getLocalizedMessage()); WarpDrive.logger.warn(String.format("XML error at line %d: %s",
exception.getLineNumber(),
exception.getLocalizedMessage() ));
// exception.printStackTrace(); // exception.printStackTrace();
} }
}; };

View file

@ -2,17 +2,18 @@
<xs:schema <xs:schema
version="1.0" version="1.0"
elementFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="WarpDrive" targetNamespace="http://warpdrive.lemadec.org"
xmlns:wd="http://warpdrive.lemadec.org"
xmlns:xs="http://www.w3.org/2001/XMLSchema"> xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="forElement"> <xs:complexType name="elementFor">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="metashell" type="metashellElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="metashell" type="wd:elementMetashell" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="replacement" type="replacementElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="replacement" type="wd:elementReplacement" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="shell" type="shellElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="shell" type="wd:elementShell" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="variable" type="xs:string" use="required" /> <xs:attribute name="variable" type="xs:string" use="required" />
<xs:attribute name="from" type="xs:string" use="optional" /> <xs:attribute name="from" type="xs:string" use="optional" />
@ -21,11 +22,11 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="fillerSetElement"> <xs:complexType name="elementFillerSet">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="group" type="xs:string" use="required" /> <xs:attribute name="group" type="xs:string" use="required" />
<xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" />
@ -34,13 +35,13 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="importElement"> <xs:complexType name="elementImport">
<xs:attribute name="group" type="xs:string" use="required" /> <xs:attribute name="group" type="xs:string" use="required" />
<xs:attribute name="name" type="xs:string" use="optional" /> <xs:attribute name="name" type="xs:string" use="optional" />
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="fillerElement"> <xs:complexType name="elementFiller">
<xs:attribute name="block" type="xs:string" use="required" /> <xs:attribute name="block" type="xs:string" use="required" />
<xs:attribute name="metadata" type="xs:string" use="optional" /> <xs:attribute name="metadata" type="xs:string" use="optional" />
<xs:attribute name="nbt" type="xs:string" use="optional" /> <xs:attribute name="nbt" type="xs:string" use="optional" />
@ -49,12 +50,13 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="structureElement"> <xs:complexType name="elementStructure">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="metashell" type="metashellElement" minOccurs="0" maxOccurs="1" /> <xs:element name="metashell" type="wd:elementMetashell" minOccurs="0" maxOccurs="1" />
<xs:element name="shell" type="shellElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="schematic" type="wd:elementSchematic" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="shell" type="wd:elementShell" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="group" type="xs:string" use="required" /> <xs:attribute name="group" type="xs:string" use="required" />
<xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" />
@ -63,10 +65,10 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="schematicElement"> <xs:complexType name="elementSchematic">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="replacement" type="replacementElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="replacement" type="wd:elementReplacement" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="group" type="xs:string" use="required" /> <xs:attribute name="group" type="xs:string" use="required" />
<xs:attribute name="name" type="xs:string" use="optional" /> <xs:attribute name="name" type="xs:string" use="optional" />
@ -76,21 +78,21 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="replacementElement"> <xs:complexType name="elementReplacement">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="block" type="xs:string" use="required" /> <xs:attribute name="block" type="xs:string" use="required" />
<xs:attribute name="metadata" type="xs:string" use="optional" /> <xs:attribute name="metadata" type="xs:string" use="optional" />
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="lootSetElement"> <xs:complexType name="elementLootSet">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="loot" type="lootElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="loot" type="wd:elementLoot" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="group" type="xs:string" use="required" /> <xs:attribute name="group" type="xs:string" use="required" />
<xs:attribute name="name" type="xs:string" use="optional" /> <xs:attribute name="name" type="xs:string" use="optional" />
@ -99,7 +101,7 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="lootElement"> <xs:complexType name="elementLoot">
<xs:attribute name="item" type="xs:string" use="required" /> <xs:attribute name="item" type="xs:string" use="required" />
<xs:attribute name="damage" type="xs:string" use="optional" /> <xs:attribute name="damage" type="xs:string" use="optional" />
<xs:attribute name="nbt" type="xs:string" use="optional" /> <xs:attribute name="nbt" type="xs:string" use="optional" />
@ -110,7 +112,7 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="metashellElement"> <xs:complexType name="elementMetashell">
<xs:attribute name="block" type="xs:string" use="optional" /> <xs:attribute name="block" type="xs:string" use="optional" />
<xs:attribute name="metadata" type="xs:string" use="optional" /> <xs:attribute name="metadata" type="xs:string" use="optional" />
<xs:attribute name="minCount" type="xs:string" use="required" /> <xs:attribute name="minCount" type="xs:string" use="required" />
@ -120,11 +122,11 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="shellElement"> <xs:complexType name="elementShell">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="minThickness" type="xs:string" use="required" /> <xs:attribute name="minThickness" type="xs:string" use="required" />
@ -133,7 +135,7 @@
</xs:complexType> </xs:complexType>
<xs:complexType name="celestialObjectElement"> <xs:complexType name="elementCelestialObject">
<xs:sequence> <xs:sequence>
<xs:element name="parent" minOccurs="0" maxOccurs="1"> <xs:element name="parent" minOccurs="0" maxOccurs="1">
<xs:complexType> <xs:complexType>
@ -144,7 +146,7 @@
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
<xs:sequence> <xs:sequence>
<xs:element name="center" type="positionElement" minOccurs="1" maxOccurs="1" /> <xs:element name="center" type="wd:elementPosition" minOccurs="1" maxOccurs="1" />
</xs:sequence> </xs:sequence>
<xs:attribute name="name" type="xs:string" use="optional" /> <xs:attribute name="name" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
@ -152,12 +154,12 @@
<xs:element name="size" minOccurs="1" maxOccurs="1"> <xs:element name="size" minOccurs="1" maxOccurs="1">
<xs:complexType> <xs:complexType>
<xs:attribute name="x" type="worldSizeType" use="required" /> <xs:attribute name="x" type="wd:typeWorldSize" use="required" />
<xs:attribute name="z" type="worldSizeType" use="required" /> <xs:attribute name="z" type="wd:typeWorldSize" use="required" />
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="dimension" type="dimensionElement" minOccurs="0" maxOccurs="1" /> <xs:element name="dimension" type="wd:elementDimension" minOccurs="0" maxOccurs="1" />
<xs:element name="skybox" minOccurs="0" maxOccurs="1"> <xs:element name="skybox" minOccurs="0" maxOccurs="1">
<xs:complexType> <xs:complexType>
@ -167,21 +169,21 @@
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
<xs:sequence> <xs:sequence>
<xs:element name="backgroundColor" type="colorElement" minOccurs="0" maxOccurs="1" /> <xs:element name="backgroundColor" type="wd:elementColor" minOccurs="0" maxOccurs="1" />
<xs:element name="starBrightnessBase" type="xs:float" minOccurs="0" maxOccurs="1" /> <xs:element name="starBrightnessBase" type="xs:float" minOccurs="0" maxOccurs="1" />
<xs:element name="starBrightnessVanilla" type="xs:float" minOccurs="0" maxOccurs="1" /> <xs:element name="starBrightnessVanilla" type="xs:float" minOccurs="0" maxOccurs="1" />
<xs:element name="celestialObjectOpacity" type="xs:float" minOccurs="0" maxOccurs="1" /> <xs:element name="celestialObjectOpacity" type="xs:float" minOccurs="0" maxOccurs="1" />
<xs:element name="fogColor" type="colorElement" minOccurs="0" maxOccurs="1" /> <xs:element name="fogColor" type="wd:elementColor" minOccurs="0" maxOccurs="1" />
<xs:element name="fogFactor" type="colorElement" minOccurs="0" maxOccurs="1" /> <xs:element name="fogFactor" type="wd:elementColor" minOccurs="0" maxOccurs="1" />
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="render" type="renderElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="render" type="wd:elementRender" minOccurs="0" maxOccurs="unbounded" />
<xs:choice minOccurs="0" maxOccurs="1"> <xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="celestialObject" type="celestialObjectElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="celestialObject" type="wd:elementCelestialObject" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
</xs:sequence> </xs:sequence>
@ -190,16 +192,16 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="dimensionElement"> <xs:complexType name="elementDimension">
<xs:annotation> <xs:annotation>
<xs:documentation xml:lang="en"> <xs:documentation xml:lang="en">
Defines the actual game world characteristics. Defines the actual game world characteristics.
</xs:documentation> </xs:documentation>
</xs:annotation> </xs:annotation>
<xs:sequence minOccurs="1" maxOccurs="1"> <xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="center" type="positionElement" minOccurs="1" maxOccurs="1" /> <xs:element name="center" type="wd:elementPosition" minOccurs="1" maxOccurs="1" />
<xs:element name="generate" type="generateElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="generate" type="wd:elementGenerate" minOccurs="0" maxOccurs="unbounded" />
<!-- <xs:element name="effects" type="effectElement" minOccurs="0" maxOccurs="unbounded" /> @TODO Not implemented --> <!-- <xs:element name="effects" type="wd:effectElement" minOccurs="0" maxOccurs="unbounded" /> @TODO Not implemented -->
</xs:sequence> </xs:sequence>
<xs:attribute name="id" type="xs:int" use="required" /> <xs:attribute name="id" type="xs:int" use="required" />
@ -222,18 +224,18 @@
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />
</xs:complexType> </xs:complexType>
<xs:complexType name="positionElement"> <xs:complexType name="elementPosition">
<xs:attribute name="x" type="worldPositionType" use="required" /> <xs:attribute name="x" type="wd:typeWorldPosition" use="required" />
<xs:attribute name="z" type="worldPositionType" use="required" /> <xs:attribute name="z" type="wd:typeWorldPosition" use="required" />
</xs:complexType> </xs:complexType>
<xs:complexType name="colorElement"> <xs:complexType name="elementColor">
<xs:attribute name="red" type="xs:float" use="required" /> <xs:attribute name="red" type="xs:float" use="required" />
<xs:attribute name="green" type="xs:float" use="required" /> <xs:attribute name="green" type="xs:float" use="required" />
<xs:attribute name="blue" type="xs:float" use="required" /> <xs:attribute name="blue" type="xs:float" use="required" />
</xs:complexType> </xs:complexType>
<xs:complexType name="renderElement"> <xs:complexType name="elementRender">
<xs:attribute name="red" type="xs:float" use="required" /> <xs:attribute name="red" type="xs:float" use="required" />
<xs:attribute name="green" type="xs:float" use="required" /> <xs:attribute name="green" type="xs:float" use="required" />
<xs:attribute name="blue" type="xs:float" use="required" /> <xs:attribute name="blue" type="xs:float" use="required" />
@ -244,19 +246,19 @@
<xs:attribute name="additive" type="xs:boolean" use="optional" default="false" /> <xs:attribute name="additive" type="xs:boolean" use="optional" default="false" />
</xs:complexType> </xs:complexType>
<xs:complexType name="generateElement"> <xs:complexType name="elementGenerate">
<xs:attribute name="group" type="xs:string" use="required" /> <xs:attribute name="group" type="xs:string" use="required" />
<xs:attribute name="ratio" type="xs:string" use="required" /> <xs:attribute name="ratio" type="xs:string" use="required" />
</xs:complexType> </xs:complexType>
<xs:simpleType name="worldSizeType"> <xs:simpleType name="typeWorldSize">
<xs:restriction base="xs:unsignedInt"> <xs:restriction base="xs:unsignedInt">
<xs:maxInclusive value="2000000" /> <xs:maxInclusive value="2000000" />
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:simpleType name="worldPositionType"> <xs:simpleType name="typeWorldPosition">
<xs:annotation> <xs:annotation>
<xs:documentation xml:lang="en"> <xs:documentation xml:lang="en">
Vanilla block positions is limited to +/- 30000 km. Vanilla block positions is limited to +/- 30000 km.
@ -269,14 +271,14 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
<xs:complexType name="forRootElement"> <xs:complexType name="elementForRoot">
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forRootElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementForRoot" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="fillerSet" type="fillerSetElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="fillerSet" type="wd:elementFillerSet" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="lootSet" type="lootSetElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="lootSet" type="wd:elementLootSet" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="schematic" type="schematicElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="schematic" type="wd:elementSchematic" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="structure" type="structureElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="structure" type="wd:elementStructure" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="celestialObject" type="celestialObjectElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="celestialObject" type="wd:elementCelestialObject" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="variable" type="xs:string" use="required" /> <xs:attribute name="variable" type="xs:string" use="required" />
<xs:attribute name="from" type="xs:string" use="optional" /> <xs:attribute name="from" type="xs:string" use="optional" />
@ -288,12 +290,12 @@
<xs:element name="worldGeneration"> <xs:element name="worldGeneration">
<xs:complexType> <xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="for" type="forRootElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="for" type="wd:elementForRoot" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="fillerSet" type="fillerSetElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="fillerSet" type="wd:elementFillerSet" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="lootSet" type="lootSetElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="lootSet" type="wd:elementLootSet" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="schematic" type="schematicElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="schematic" type="wd:elementSchematic" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="structure" type="structureElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="structure" type="wd:elementStructure" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="celestialObject" type="celestialObjectElement" minOccurs="0" maxOccurs="unbounded" /> <xs:element name="celestialObject" type="wd:elementCelestialObject" minOccurs="0" maxOccurs="unbounded" />
</xs:choice> </xs:choice>
<xs:attribute name="version" type="xs:string" use="required" fixed="2" /> <xs:attribute name="version" type="xs:string" use="required" fixed="2" />
<xs:attribute name="mods" type="xs:string" use="optional" /> <xs:attribute name="mods" type="xs:string" use="optional" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd"> xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd">
<!-- <!--
An astronomical object or celestial object is a naturally occurring physical entity, association, or structure in the observable universe. An astronomical object or celestial object is a naturally occurring physical entity, association, or structure in the observable universe.
@ -17,9 +17,9 @@
<!-- Top level is hyperspace, typically a galaxy. --> <!-- Top level is hyperspace, typically a galaxy. -->
<celestialObject group="milkyWay" name="hyperspace"> <celestialObject group="milkyWay" name="hyperspace">
<!-- <!--
side defines the world border size, measured in blocks. This is also the size of the orbit area in space, so don't go too big. size defines the world border size, measured in blocks. This is also the size of the orbit area in space, so don't go too big.
--> -->
<size x="100000" z="100000" /> <size x="400000" z="400000" />
<!-- <!--
dimension defines an actual game world. If it's missing, that celestialObject remains visible but you can't "land" on it. dimension defines an actual game world. If it's missing, that celestialObject remains visible but you can't "land" on it.
@ -61,7 +61,7 @@
parent.center.x, parent.center.z: this is the center coordinates in the parent dimension, measured in blocks. parent.center.x, parent.center.z: this is the center coordinates in the parent dimension, measured in blocks.
--> -->
<parent> <parent>
<center x="0" z="0" /> <center x="50000" z="10000" />
</parent> </parent>
<size x="200000" z="200000" /> <size x="200000" z="200000" />
<dimension id="-2" isBreathable="false" gravity="legacySpace" isProvidedByWarpDrive="true"> <dimension id="-2" isBreathable="false" gravity="legacySpace" isProvidedByWarpDrive="true">

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd"> xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd">
<celestialBody group="milkyWay" name="sun" isVirtual="true"> <celestialBody group="milkyWay" name="sun" isVirtual="true">
<dimension type="space" id="" centerX="" centerZ="" radiusX="" radiusZ="" /> <dimension type="space" id="" centerX="" centerZ="" radiusX="" radiusZ="" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd"> xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd">
<!-- all possible overworld ores, mostly for reference purpose --> <!-- all possible overworld ores, mostly for reference purpose -->
<fillerSet group="overworld_allOres" name="stone"> <fillerSet group="overworld_allOres" name="stone">

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd" xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd"
mods="netherores"> mods="netherores">
<!-- reference ratios <!-- reference ratios

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd" xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd"
mods="UndergroundBiomes"> mods="UndergroundBiomes">
<for variable="type" in="igneous,metamorphic,sedimentary"> <for variable="type" in="igneous,metamorphic,sedimentary">

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd"> xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd">
<!-- <!--
A lootSet is a list of possible loots. A lootSet is a list of possible loots.

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd"> xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd">
<structure group="star" name="red_dwarf" ratio="0.2"> <structure group="star" name="red_dwarf" ratio="0.2">
<shell name="core" minThickness="40" maxThickness="50"><!-- legacy radius was 42 --> <shell name="core" minThickness="40" maxThickness="50"><!-- legacy radius was 42 -->
@ -169,7 +169,7 @@
</structure> </structure>
<structure group="moon" name="overworld.ship" weight="10"> <structure group="moon" name="overworld.ship" weight="10">
<schematic group="smallship" /> <schematic group="smallship" filename="notImplemented.schematic" />
<shell name="core" minThickness="5" maxThickness="16"> <shell name="core" minThickness="5" maxThickness="16">
<import group="gas" /> <import group="gas" />
<filler block="minecraft:bedrock" ratio=".001" /> <filler block="minecraft:bedrock" ratio=".001" />

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd" xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd"
mods="netherores"> mods="netherores">
<!-- Not implemented <!-- Not implemented

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<worldGeneration version="2" <worldGeneration version="2"
xmlns="WarpDrive" xmlns="http://warpdrive.lemadec.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="WarpDrive WarpDrive.xsd"> xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd">
<schematic group="ship" name="legacy" filename="legacy" weight="1"> <schematic group="ship" name="legacy" filename="legacy" weight="1">
<replacement block="minecraft:stone" metadata="0"> <replacement block="minecraft:stone" metadata="0">