Multiverse-Core

Multiverse-Core

6M Downloads

[Bug]: ModifyCommand gamemode value is enum and not string

Pookachu opened this issue ยท 6 comments

commented

/mv version -p output

Multiverse Core Version vlocal Multiverse Core Authors dumptruckman, Rigby, fernferret, lithium3141, main--, benwoo1110, Zax71 Special Code: FRN002

Server logs

https://gist.github.com/Pookachu/38f8147ce70db23f82c0e3442296ded9

Server Version

This server is running Paper version 1.21.1-120-master@57c75a4 (2024-10-09T21:11:07Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.1-119-7cd4f2c (MC: 1.21.1)

Bug Description

When running

/mv modify [world] gamemode [value]

it outputs an error stating:

Failed to set property gamemode to creative for world spawn.
class java.lang.String cannot be cast to class java.lang.Enum (java.lang.String and java.lang.Enum are in module java.base of loader 'bootstrap')

I personally believe the responsible code is:

            @Optional
            @Syntax("[value]")
            @Description("")
            String propertyValue) {
        StringPropertyHandle worldPropertyHandle = world.getStringPropertyHandle();
        worldPropertyHandle.modifyProperty(propertyName, propertyValue, action).onSuccess(ignore -> {
            issuer.sendMessage("Property %s%s set to %s%s for world %s%s%s.".formatted(
                    propertyName,
                    ChatColor.BLUE,
                    worldPropertyHandle.getProperty(propertyName).getOrNull(),
                    ChatColor.BLUE,
                    ChatColor.GRAY,
                    world.getName(),
                    ChatColor.BLUE
            ));

Which is located in ModifyCommand.java

Steps to reproduce

  1. Start a server with mv installed
  2. Attempt to modify the gamemode of a world with /mvm [world] set gamemode [value]

Agreements

  • I have searched for and ensured there isn't already an open or resolved issue(s) regarding this.
  • I was able to reproduce my issue on a freshly setup and up-to-date server with the latest version of Multiverse plugins with no other plugins and with no kinds of other server or client mods.
commented

NOTE: The errors in the gist don't appear in a fresh setup and can be ignored. I believe it has something to do with mv-portals which I've since removed.

commented

Can I confirm you are using the the MV5 branch which you compiled by yourself?

commented

Yes. I should probably have been more clear on that.

commented

Also, thanks for testing MV5, please help find as many bugs as possible ;D

commented

Fixed in #3115

here's the compiled build for you
multiverse-core-local.zip

commented

Thank you!