Skip to content

Format-strings instead of string concatenation #360

@main--

Description

@main--

Does @Multiverse notify all MV-Devs? I hope so.

I would like to know your opinion about changes like this one:

Now:

message.sendMessages(teleporter, new String[]{"You don't have permission to teleport another player to a " + ChatColor.GREEN + destination.getType() + " Destination.", ChatColor.RED + "   (multiverse.teleport.other." + destination.getIdentifier() + ")"});

(taken from TeleportCommand.java @ 562de0f, just as example)


How I would like to change that:

message.sendMessages(teleporter, new String[] {String.format("You don't have permission to teleport another player to a %s%s Destination.", ChatColor.GREEN, destination.getType()), String.format("%s(multiverse.teleport.other.%s)", ChatColor.RED, destination.getIdentifier())});

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR: Better CodingImprovements in code, but not introducing new features.Resolution: AcceptedMV-Team is aware of the issue/PR and will be looking into it.Type: IdeaSuggestion for a new feature or enhancement.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions