Default wool pre touch metric to off

This commit is contained in:
Austin Mayes 2019-06-01 15:02:42 -05:00
parent 262b813a11
commit 2011aac324
No known key found for this signature in database
GPG Key ID: 72C78ABE045D34F6
3 changed files with 10 additions and 2 deletions

View File

@ -70,6 +70,7 @@ public class ProximityMetric {
public static ProximityMetric parse(Element el, String prefix, ProximityMetric def) throws InvalidXMLException {
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),
XMLUtils.parseBoolean(el.getAttribute(prefix + "proximity-horizontal"), def.horizontal));
}

View File

@ -45,6 +45,9 @@ public class ProtoVersions {
// 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);
// 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
public static final SemanticVersion CURRENT = ENABLE_BLOCK_36;
public static final SemanticVersion CURRENT = WOOL_PRE_TOUCH_OFF;
}

View File

@ -41,7 +41,11 @@ public class WoolParser implements FeatureDefinitionParser<MonumentWoolFactory>
teamParser.property(el, "owner")
.alias("team")
.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)),
dyeColors.property(el, "color").required(),
location,