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:
parent
f65879eb8d
commit
6fc9735da9
12 changed files with 179 additions and 111 deletions
|
@ -61,8 +61,51 @@ public class CelestialObjectManager extends XmlFileManager {
|
|||
}
|
||||
|
||||
// check overlapping regions
|
||||
int countErrors = 0;
|
||||
for (CelestialObject celestialObject1 : celestialObjects) {
|
||||
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) {
|
||||
if (celestialObject1 == celestialObject2) {
|
||||
continue;
|
||||
|
@ -72,29 +115,45 @@ public class CelestialObjectManager extends XmlFileManager {
|
|||
final AxisAlignedBB areaInParent1 = celestialObject1.getAreaInParent();
|
||||
final AxisAlignedBB areaInParent2 = celestialObject2.getAreaInParent();
|
||||
if (areaInParent1.intersectsWith(areaInParent2)) {
|
||||
WarpDrive.logger.error("Overlapping parent areas detected " + celestialObject1.parentDimensionId);
|
||||
WarpDrive.logger.error("Celestial object 1 is " + celestialObject1 + " with area " + areaInParent1);
|
||||
WarpDrive.logger.error("Celestial object 2 is " + celestialObject2 + " with area " + areaInParent2);
|
||||
throw new RuntimeException(String.format(
|
||||
"Invalid celestial objects definition:\n %s\nand\n %s\nare overlapping each others. Update your configuration to fix it.",
|
||||
celestialObject1.toString(), celestialObject2.toString()));
|
||||
countErrors++;
|
||||
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",
|
||||
countErrors,
|
||||
celestialObject1.parentDimensionId,
|
||||
celestialObject1.getFullName(),
|
||||
celestialObject2.getFullName(),
|
||||
areaInParent1,
|
||||
celestialObject1,
|
||||
areaInParent2,
|
||||
celestialObject2 ));
|
||||
}
|
||||
}
|
||||
// are they in the same dimension?
|
||||
if (!celestialObject1.isVirtual && !celestialObject2.isVirtual && celestialObject1.dimensionId == celestialObject2.dimensionId) {
|
||||
final AxisAlignedBB areaToReachParent1 = celestialObject1.getAreaToReachParent();
|
||||
final AxisAlignedBB areaToReachParent2 = celestialObject2.getAreaToReachParent();
|
||||
if (areaToReachParent1.intersectsWith(areaToReachParent2)) {
|
||||
WarpDrive.logger.error("Overlapping areas detected in dimension " + celestialObject1.dimensionId);
|
||||
WarpDrive.logger.error("Celestial object 1 is " + celestialObject1 + " with area " + areaToReachParent1);
|
||||
WarpDrive.logger.error("Celestial object 2 is " + celestialObject2 + " with area " + areaToReachParent2);
|
||||
throw new RuntimeException(String.format(
|
||||
"Invalid celestial objects definition:\n %s\nand\n %s\nare overlapping each others. Update your configuration to fix it.",
|
||||
celestialObject1.toString(), celestialObject2.toString()));
|
||||
final AxisAlignedBB worldBorderArea1 = celestialObject1.getWorldBorderArea();
|
||||
final AxisAlignedBB worldBorderArea2 = celestialObject2.getWorldBorderArea();
|
||||
if (worldBorderArea1.intersectsWith(worldBorderArea2)) {
|
||||
countErrors++;
|
||||
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",
|
||||
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(
|
||||
"Invalid celestial objects definition: update your configuration to fix those %d validation errors, see logs for details.",
|
||||
countErrors));
|
||||
}
|
||||
|
||||
|
||||
// We're not checking invalid dimension id, so they can be pre-allocated (see MystCraft)
|
||||
}
|
||||
|
|
|
@ -1012,19 +1012,26 @@ public class WarpDriveConfig {
|
|||
ErrorHandler xmlErrorHandler = new ErrorHandler() {
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -2,17 +2,18 @@
|
|||
<xs:schema
|
||||
version="1.0"
|
||||
elementFormDefault="qualified"
|
||||
targetNamespace="WarpDrive"
|
||||
targetNamespace="http://warpdrive.lemadec.org"
|
||||
xmlns:wd="http://warpdrive.lemadec.org"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
|
||||
<xs:complexType name="forElement">
|
||||
<xs:complexType name="elementFor">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="metashell" type="metashellElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="replacement" type="replacementElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="shell" type="shellElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="metashell" type="wd:elementMetashell" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="replacement" type="wd:elementReplacement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="shell" type="wd:elementShell" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="variable" type="xs:string" use="required" />
|
||||
<xs:attribute name="from" type="xs:string" use="optional" />
|
||||
|
@ -21,11 +22,11 @@
|
|||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="fillerSetElement">
|
||||
<xs:complexType name="elementFillerSet">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="group" 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:complexType>
|
||||
|
||||
<xs:complexType name="importElement">
|
||||
<xs:complexType name="elementImport">
|
||||
<xs:attribute name="group" type="xs:string" use="required" />
|
||||
<xs:attribute name="name" type="xs:string" use="optional" />
|
||||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="fillerElement">
|
||||
<xs:complexType name="elementFiller">
|
||||
<xs:attribute name="block" type="xs:string" use="required" />
|
||||
<xs:attribute name="metadata" 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:complexType>
|
||||
|
||||
<xs:complexType name="structureElement">
|
||||
<xs:complexType name="elementStructure">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="metashell" type="metashellElement" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="shell" type="shellElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="metashell" type="wd:elementMetashell" minOccurs="0" maxOccurs="1" />
|
||||
<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:attribute name="group" 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:complexType>
|
||||
|
||||
<xs:complexType name="schematicElement">
|
||||
<xs:complexType name="elementSchematic">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="replacement" type="replacementElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="replacement" type="wd:elementReplacement" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="group" type="xs:string" use="required" />
|
||||
<xs:attribute name="name" type="xs:string" use="optional" />
|
||||
|
@ -76,21 +78,21 @@
|
|||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="replacementElement">
|
||||
<xs:complexType name="elementReplacement">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="block" type="xs:string" use="required" />
|
||||
<xs:attribute name="metadata" type="xs:string" use="optional" />
|
||||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="lootSetElement">
|
||||
<xs:complexType name="elementLootSet">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="loot" type="lootElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="loot" type="wd:elementLoot" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="group" type="xs:string" use="required" />
|
||||
<xs:attribute name="name" type="xs:string" use="optional" />
|
||||
|
@ -99,7 +101,7 @@
|
|||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="lootElement">
|
||||
<xs:complexType name="elementLoot">
|
||||
<xs:attribute name="item" type="xs:string" use="required" />
|
||||
<xs:attribute name="damage" 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:complexType>
|
||||
|
||||
<xs:complexType name="metashellElement">
|
||||
<xs:complexType name="elementMetashell">
|
||||
<xs:attribute name="block" type="xs:string" use="optional" />
|
||||
<xs:attribute name="metadata" type="xs:string" use="optional" />
|
||||
<xs:attribute name="minCount" type="xs:string" use="required" />
|
||||
|
@ -120,11 +122,11 @@
|
|||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="shellElement">
|
||||
<xs:complexType name="elementShell">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="importElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="fillerElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="import" type="wd:elementImport" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="filler" type="wd:elementFiller" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="minThickness" type="xs:string" use="required" />
|
||||
|
@ -133,7 +135,7 @@
|
|||
</xs:complexType>
|
||||
|
||||
|
||||
<xs:complexType name="celestialObjectElement">
|
||||
<xs:complexType name="elementCelestialObject">
|
||||
<xs:sequence>
|
||||
<xs:element name="parent" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
|
@ -144,7 +146,7 @@
|
|||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<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:attribute name="name" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
@ -152,12 +154,12 @@
|
|||
|
||||
<xs:element name="size" minOccurs="1" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="x" type="worldSizeType" use="required" />
|
||||
<xs:attribute name="z" type="worldSizeType" use="required" />
|
||||
<xs:attribute name="x" type="wd:typeWorldSize" use="required" />
|
||||
<xs:attribute name="z" type="wd:typeWorldSize" use="required" />
|
||||
</xs:complexType>
|
||||
</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:complexType>
|
||||
|
@ -167,21 +169,21 @@
|
|||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<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="starBrightnessVanilla" 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="fogFactor" type="colorElement" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="fogColor" type="wd:elementColor" minOccurs="0" maxOccurs="1" />
|
||||
<xs:element name="fogFactor" type="wd:elementColor" minOccurs="0" maxOccurs="1" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</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:element name="for" type="forElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="celestialObject" type="celestialObjectElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementFor" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="celestialObject" type="wd:elementCelestialObject" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
|
||||
|
@ -190,16 +192,16 @@
|
|||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="dimensionElement">
|
||||
<xs:complexType name="elementDimension">
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Defines the actual game world characteristics.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:sequence minOccurs="1" maxOccurs="1">
|
||||
<xs:element name="center" type="positionElement" minOccurs="1" maxOccurs="1" />
|
||||
<xs:element name="generate" type="generateElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<!-- <xs:element name="effects" type="effectElement" minOccurs="0" maxOccurs="unbounded" /> @TODO Not implemented -->
|
||||
<xs:element name="center" type="wd:elementPosition" minOccurs="1" maxOccurs="1" />
|
||||
<xs:element name="generate" type="wd:elementGenerate" minOccurs="0" maxOccurs="unbounded" />
|
||||
<!-- <xs:element name="effects" type="wd:effectElement" minOccurs="0" maxOccurs="unbounded" /> @TODO Not implemented -->
|
||||
</xs:sequence>
|
||||
|
||||
<xs:attribute name="id" type="xs:int" use="required" />
|
||||
|
@ -222,18 +224,18 @@
|
|||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="positionElement">
|
||||
<xs:attribute name="x" type="worldPositionType" use="required" />
|
||||
<xs:attribute name="z" type="worldPositionType" use="required" />
|
||||
<xs:complexType name="elementPosition">
|
||||
<xs:attribute name="x" type="wd:typeWorldPosition" use="required" />
|
||||
<xs:attribute name="z" type="wd:typeWorldPosition" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="colorElement">
|
||||
<xs:complexType name="elementColor">
|
||||
<xs:attribute name="red" type="xs:float" use="required" />
|
||||
<xs:attribute name="green" type="xs:float" use="required" />
|
||||
<xs:attribute name="blue" type="xs:float" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="renderElement">
|
||||
<xs:complexType name="elementRender">
|
||||
<xs:attribute name="red" type="xs:float" use="required" />
|
||||
<xs:attribute name="green" 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:complexType>
|
||||
|
||||
<xs:complexType name="generateElement">
|
||||
<xs:complexType name="elementGenerate">
|
||||
<xs:attribute name="group" type="xs:string" use="required" />
|
||||
<xs:attribute name="ratio" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
|
||||
|
||||
<xs:simpleType name="worldSizeType">
|
||||
<xs:simpleType name="typeWorldSize">
|
||||
<xs:restriction base="xs:unsignedInt">
|
||||
<xs:maxInclusive value="2000000" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="worldPositionType">
|
||||
<xs:simpleType name="typeWorldPosition">
|
||||
<xs:annotation>
|
||||
<xs:documentation xml:lang="en">
|
||||
Vanilla block positions is limited to +/- 30000 km.
|
||||
|
@ -269,14 +271,14 @@
|
|||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:complexType name="forRootElement">
|
||||
<xs:complexType name="elementForRoot">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forRootElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="fillerSet" type="fillerSetElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="lootSet" type="lootSetElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="schematic" type="schematicElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="structure" type="structureElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="celestialObject" type="celestialObjectElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementForRoot" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="fillerSet" type="wd:elementFillerSet" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="lootSet" type="wd:elementLootSet" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="schematic" type="wd:elementSchematic" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="structure" type="wd:elementStructure" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="celestialObject" type="wd:elementCelestialObject" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="variable" type="xs:string" use="required" />
|
||||
<xs:attribute name="from" type="xs:string" use="optional" />
|
||||
|
@ -288,12 +290,12 @@
|
|||
<xs:element name="worldGeneration">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="for" type="forRootElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="fillerSet" type="fillerSetElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="lootSet" type="lootSetElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="schematic" type="schematicElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="structure" type="structureElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="celestialObject" type="celestialObjectElement" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="for" type="wd:elementForRoot" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="fillerSet" type="wd:elementFillerSet" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="lootSet" type="wd:elementLootSet" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="schematic" type="wd:elementSchematic" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="structure" type="wd:elementStructure" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="celestialObject" type="wd:elementCelestialObject" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="version" type="xs:string" use="required" fixed="2" />
|
||||
<xs:attribute name="mods" type="xs:string" use="optional" />
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
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.
|
||||
|
@ -17,9 +17,9 @@
|
|||
<!-- Top level is hyperspace, typically a galaxy. -->
|
||||
<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.
|
||||
|
@ -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="0" z="0" />
|
||||
<center x="50000" z="10000" />
|
||||
</parent>
|
||||
<size x="200000" z="200000" />
|
||||
<dimension id="-2" isBreathable="false" gravity="legacySpace" isProvidedByWarpDrive="true">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
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">
|
||||
<dimension type="space" id="" centerX="" centerZ="" radiusX="" radiusZ="" />
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
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 -->
|
||||
<fillerSet group="overworld_allOres" name="stone">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="WarpDrive WarpDrive.xsd"
|
||||
xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd"
|
||||
mods="netherores">
|
||||
|
||||
<!-- reference ratios
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="WarpDrive WarpDrive.xsd"
|
||||
xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd"
|
||||
mods="UndergroundBiomes">
|
||||
|
||||
<for variable="type" in="igneous,metamorphic,sedimentary">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
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.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
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">
|
||||
<shell name="core" minThickness="40" maxThickness="50"><!-- legacy radius was 42 -->
|
||||
|
@ -169,7 +169,7 @@
|
|||
</structure>
|
||||
|
||||
<structure group="moon" name="overworld.ship" weight="10">
|
||||
<schematic group="smallship" />
|
||||
<schematic group="smallship" filename="notImplemented.schematic" />
|
||||
<shell name="core" minThickness="5" maxThickness="16">
|
||||
<import group="gas" />
|
||||
<filler block="minecraft:bedrock" ratio=".001" />
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="WarpDrive WarpDrive.xsd"
|
||||
xsi:schemaLocation="http://warpdrive.lemadec.org WarpDrive.xsd"
|
||||
mods="netherores">
|
||||
|
||||
<!-- Not implemented
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<worldGeneration version="2"
|
||||
xmlns="WarpDrive"
|
||||
xmlns="http://warpdrive.lemadec.org"
|
||||
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">
|
||||
<replacement block="minecraft:stone" metadata="0">
|
||||
|
|
Loading…
Reference in a new issue