diff --git a/src/main/java/carpet/script/utils/ShapeDispatcher.java b/src/main/java/carpet/script/utils/ShapeDispatcher.java index 45d58dc3..97218549 100644 --- a/src/main/java/carpet/script/utils/ShapeDispatcher.java +++ b/src/main/java/carpet/script/utils/ShapeDispatcher.java @@ -177,7 +177,7 @@ public class ShapeDispatcher protected int duration = 0; private int key; protected int followEntity; - protected DimensionType entityDimension; + protected RegistryKey entityDimension; protected ExpiringShape() { } @@ -222,7 +222,7 @@ public class ShapeDispatcher if (options.containsKey("follow")) { followEntity = NumericValue.asNumber(options.getOrDefault("follow", optional.get("follow"))).getInt(); - entityDimension = Registry.DIMENSION_TYPE.get(new Identifier(options.get("dim").getString())); + entityDimension = RegistryKey.of(Registry.DIMENSION, new Identifier(options.get("dim").getString())); } } public int getExpiry() { return duration; } @@ -609,13 +609,7 @@ public class ShapeDispatcher public static class DimensionParam extends StringParam { @Override - public Value validate(Map options, CarpetContext cc, Value value) - { - String dimStr = value.getString(); - Optional dimOp = Registry.DIMENSION_TYPE.getOrEmpty(new Identifier(dimStr)); - if (!dimOp.isPresent()) throw new InternalExpressionException("Unknown dimension "+dimStr); - return value; - } + public Value validate(Map options, CarpetContext cc, Value value) { return value; } @Override public boolean appliesTo(ExpiringShape shape) { return true; } @Override diff --git a/src/main/java/carpet/script/utils/ShapesRenderer.java b/src/main/java/carpet/script/utils/ShapesRenderer.java index e10117c2..62ce62d3 100644 --- a/src/main/java/carpet/script/utils/ShapesRenderer.java +++ b/src/main/java/carpet/script/utils/ShapesRenderer.java @@ -164,11 +164,11 @@ public class ShapesRenderer { return shape.key(); }; - public boolean shouldRender(DimensionType dim) + public boolean shouldRender(RegistryKey dim) { if (shape.followEntity <=0 ) return true; if (client.world == null) return false; - if (client.world.dimension.getType() != dim) return false; + if (client.world.method_27983() != dim) return false; if (client.world.getEntityById(shape.followEntity) == null) return false; return true; }