Merge branch 'master' into 1.16

This commit is contained in:
gnembon committed 2020-06-10 12:31:00 -03:00
commit 2912fd2936
3 files changed
+248 -19

No files matched your search

@@ -716,7 +716,7 @@ public class ShapeDispatcher
put("center", new Vec3Param("center", false));
put("radius", new PositiveFloatParam("radius"));
put("level", new PositiveIntParam("level"));
put("height", new NonNegativeFloatParam("height"));
put("height", new FloatParam("height"));
put("axis", new StringChoiceParam("axis", "x", "y", "z"));
put("points", new PointsParam("points"));
}};
@@ -790,6 +790,15 @@ public class ShapeDispatcher
return value;
}
}
public static class FloatParam extends NumericParam
{
protected FloatParam(String id) { super(id); }
@Override
public Value decode(Tag tag) { return new NumericValue(((FloatTag)tag).getFloat()); }
@Override
public Tag toTag(Value value) { return FloatTag.of(NumericValue.asNumber(value, id).getFloat()); }
}
public static abstract class PositiveParam extends NumericParam
{
protected PositiveParam(String id) { super(id); }
@@ -847,6 +856,9 @@ public class ShapeDispatcher
}
}
public static class Vec3Param extends Param
{
private boolean roundsUpForBlocks;