From 9c929fccca9be0930429db8ef82ebb45d989cf3b Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:42:15 +0800 Subject: [PATCH 1/3] Fix modify command string parsing --- .../org/mvplugins/multiverse/core/commands/ModifyCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java b/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java index 499a1fb3a..fcd0e3968 100644 --- a/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java +++ b/src/main/java/org/mvplugins/multiverse/core/commands/ModifyCommand.java @@ -61,7 +61,7 @@ void onModifyCommand( @Description("") String propertyValue) { StringPropertyHandle worldPropertyHandle = world.getStringPropertyHandle(); - worldPropertyHandle.modifyProperty(propertyName, propertyValue, action).onSuccess(ignore -> { + worldPropertyHandle.modifyPropertyString(propertyName, propertyValue, action).onSuccess(ignore -> { issuer.sendMessage("Property %s%s set to %s%s for world %s%s%s.".formatted( propertyName, ChatColor.BLUE, From 7868a1971e11ece4050d09022eaa45e4854e4476 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:43:17 +0800 Subject: [PATCH 2/3] Dont need to deserialize enum if it is already an enum --- .../configuration/functions/DefaultSerializerProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/mvplugins/multiverse/core/configuration/functions/DefaultSerializerProvider.java b/src/main/java/org/mvplugins/multiverse/core/configuration/functions/DefaultSerializerProvider.java index a81fcf97b..e88c85583 100644 --- a/src/main/java/org/mvplugins/multiverse/core/configuration/functions/DefaultSerializerProvider.java +++ b/src/main/java/org/mvplugins/multiverse/core/configuration/functions/DefaultSerializerProvider.java @@ -43,6 +43,9 @@ public static void addDefaultSerializer(@NotNull Class type, @NotNull Nod private static final NodeSerializer ENUM_SERIALIZER = new NodeSerializer<>() { @Override public Enum deserialize(Object object, Class type) { + if (type.isInstance(object)) { + return (Enum) object; + } return Enum.valueOf(type, String.valueOf(object).toUpperCase()); } From 42cfd9dcc467781c15b94fde88295b5469c1e662 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:43:49 +0800 Subject: [PATCH 3/3] Fix enforcementHandler being null in WorldConfigNodes --- .../multiverse/core/world/config/WorldConfigNodes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/mvplugins/multiverse/core/world/config/WorldConfigNodes.java b/src/main/java/org/mvplugins/multiverse/core/world/config/WorldConfigNodes.java index f13369095..d1de65a3c 100644 --- a/src/main/java/org/mvplugins/multiverse/core/world/config/WorldConfigNodes.java +++ b/src/main/java/org/mvplugins/multiverse/core/world/config/WorldConfigNodes.java @@ -28,7 +28,7 @@ public class WorldConfigNodes { private LoadedMultiverseWorld world = null; WorldConfigNodes(@NotNull MultiverseCore multiverseCore) { - this.enforcementHandler = multiverseCore.getServiceLocator().getActiveService(EnforcementHandler.class); + this.enforcementHandler = multiverseCore.getServiceLocator().getService(EnforcementHandler.class); } LoadedMultiverseWorld getWorld() {