Skip to content

Random Class Selection Issue #786

Description

@covector

Bug Report

Short Description

Using /ma class random or clicking a sign with the word random should work and give the message "You will get a random class on arena start."
Instead, when using /ma class random, it said "There is no class named random."
Did some scuffed fix in a fork and it seems to work (more info in Additional Info).

Reproduction Steps

Using /ma class random or clicking a sign with the word random.

Details

  • MobArena version: 0.107
  • Server version: paper 1.20.1
  • Stacktrace (if applicable):

Additional Info

  1. In the file PickClassCommand.java, it seems that the logic for checking if a class slug existed is done before that for checking if the slug is "random". The same goes for the function handleSign in the file ArenaListener.java.
  2. After fixing that, the player becomes unable to ready, getting the message "You must first pick a class!". In the ReadyCommand.java, it didn't take into account the arena class being null (in the case of random class). The same goes for the function handleReadyBlock in the file ArenaListener.java.

Two other things I think should be addressed:

  1. Function assignRandomClass in ArenaImpl.java didn't support for class chest.
  2. If a player chooses another kit after running the command /ma class random, the Arena should remove the player from its randoms set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/miscIssues that don't fit particularly well into any other areas.type/bugUnintended behavior or fault.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions