Default wool pre touch metric to off
This commit is contained in:
parent
262b813a11
commit
2011aac324
|
@ -70,6 +70,7 @@ public class ProximityMetric {
|
||||||
public static ProximityMetric parse(Element el, String prefix, ProximityMetric def) throws InvalidXMLException {
|
public static ProximityMetric parse(Element el, String prefix, ProximityMetric def) throws InvalidXMLException {
|
||||||
if(!prefix.isEmpty()) prefix = prefix + "-";
|
if(!prefix.isEmpty()) prefix = prefix + "-";
|
||||||
|
|
||||||
|
if (def == null && el.getAttribute(prefix + "proximity-metric") == null) return null;
|
||||||
return new ProximityMetric(XMLUtils.parseEnum(Node.fromAttr(el, prefix + "proximity-metric"), ProximityMetric.Type.class, "proximity metric", def.type),
|
return new ProximityMetric(XMLUtils.parseEnum(Node.fromAttr(el, prefix + "proximity-metric"), ProximityMetric.Type.class, "proximity metric", def.type),
|
||||||
XMLUtils.parseBoolean(el.getAttribute(prefix + "proximity-horizontal"), def.horizontal));
|
XMLUtils.parseBoolean(el.getAttribute(prefix + "proximity-horizontal"), def.horizontal));
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,9 @@ public class ProtoVersions {
|
||||||
// Enable block 36 to be used, protos before this will remove it from the map
|
// Enable block 36 to be used, protos before this will remove it from the map
|
||||||
public static final SemanticVersion ENABLE_BLOCK_36 = new SemanticVersion(1, 4, 3);
|
public static final SemanticVersion ENABLE_BLOCK_36 = new SemanticVersion(1, 4, 3);
|
||||||
|
|
||||||
|
// Wool pre touch metric defaults to null
|
||||||
|
public static final SemanticVersion WOOL_PRE_TOUCH_OFF = new SemanticVersion(1, 4, 4);
|
||||||
|
|
||||||
// Current version - change this whenever we bump the proto
|
// Current version - change this whenever we bump the proto
|
||||||
public static final SemanticVersion CURRENT = ENABLE_BLOCK_36;
|
public static final SemanticVersion CURRENT = WOOL_PRE_TOUCH_OFF;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,11 @@ public class WoolParser implements FeatureDefinitionParser<MonumentWoolFactory>
|
||||||
teamParser.property(el, "owner")
|
teamParser.property(el, "owner")
|
||||||
.alias("team")
|
.alias("team")
|
||||||
.required(),
|
.required(),
|
||||||
ProximityMetric.parse(el, "wool", new ProximityMetric(ProximityMetric.Type.CLOSEST_KILL, false)),
|
ProximityMetric.parse(el, "wool",
|
||||||
|
proto.isOlderThan(ProtoVersions.WOOL_PRE_TOUCH_OFF) ?
|
||||||
|
new ProximityMetric(ProximityMetric.Type.CLOSEST_KILL, false) :
|
||||||
|
null
|
||||||
|
),
|
||||||
ProximityMetric.parse(el, "monument", new ProximityMetric(ProximityMetric.Type.CLOSEST_BLOCK, false)),
|
ProximityMetric.parse(el, "monument", new ProximityMetric(ProximityMetric.Type.CLOSEST_BLOCK, false)),
|
||||||
dyeColors.property(el, "color").required(),
|
dyeColors.property(el, "color").required(),
|
||||||
location,
|
location,
|
||||||
|
|
Loading…
Reference in New Issue