File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
java/org/mvplugins/multiverse/core Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2323import org .mvplugins .multiverse .core .world .MultiverseWorld ;
2424import org .mvplugins .multiverse .core .world .WorldManager ;
2525
26+ import java .util .Map ;
27+
2628import static org .mvplugins .multiverse .core .locale .message .MessageReplacement .*;
2729import static org .mvplugins .multiverse .core .locale .message .MessageReplacement .replace ;
2830
2931@ Service
3032class ModifyCommand extends CoreCommand {
3133
34+ private static final Map <String , String > REMOVED_PROPERTIES = Map .of (
35+ "animals" , "/mv entity-spawn-config modify [world] animal set spawn <true|false>" ,
36+ "monsters" , "/mv entity-spawn-config modify [world] monster set spawn <true|false>"
37+ );
38+
3239 private final WorldManager worldManager ;
3340
3441 @ Inject
@@ -65,6 +72,13 @@ void onModifyCommand(// SUPPRESS CHECKSTYLE: ParameterNumber
6572 @ Syntax ("[value]" )
6673 @ Description ("{@@mv-core.modify.value.description}" )
6774 @ Nullable String propertyValue ) {
75+ if (REMOVED_PROPERTIES .containsKey (propertyName )) {
76+ issuer .sendMessage (MVCorei18n .MODIFY_PROPERTYREMOVED ,
77+ replace ("{property}" ).with (propertyName ),
78+ replace ("{replacement}" ).with (REMOVED_PROPERTIES .get (propertyName )));
79+ return ;
80+ }
81+
6882 MultiverseWorld world = worldValue .value ();
6983
7084 if (action .isRequireValue () && propertyValue == null ) {
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ public enum MVCorei18n implements MessageKeyProvider {
151151 MODIFY_WORLD_DESCRIPTION ,
152152 MODIFY_PROPERTY_DESCRIPTION ,
153153 MODIFY_VALUE_DESCRIPTION ,
154+ MODIFY_PROPERTYREMOVED ,
154155 MODIFY_CANNOTHAVEVALUE ,
155156 MODIFY_SPECIFYVALUE ,
156157 MODIFY_SUCCESS ,
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ mv-core.modify.description=Modifies a world property of a given world.
132132mv-core.modify.world.description =Name of world you want to modify.
133133mv-core.modify.property.description =Property you want to modify.
134134mv-core.modify.value.description =Value of property.
135+ mv-core.modify.propertyremoved =&cYou cannot modify '&3{property}&c' because it has been changed or removed. Please use '&a{replacement}&c' instead.
135136mv-core.modify.cannothavevalue =You cannot specify a value to {action} '{property}'.
136137mv-core.modify.specifyvalue =You must specify a value to {action} '{property}'.
137138mv-core.modify.success =&aSuccessfully {action} '&9{property}&a' to '&9{value}&a' in world &9{world}&a.
You can’t perform that action at this time.
0 commit comments