Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Add basic nations functionality #1

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open

Add basic nations functionality #1

wants to merge 50 commits into from

Conversation

kai-gitt
Copy link
Member

@kai-gitt kai-gitt commented Jan 7, 2024

This PR adds basic nation functionality (create, invite, kick, etc)

There is yet to add more functionality, as such, here is a TODO list.

  • Localisation for messages
  • Localisation config (save enum as messages.yml and have it as the first priority)
  • Admin commands (force-disband, etc)
  • Code cleanup as always
    LOOHP/InteractiveChat support
  • cloudnodeMSG support

This will close #2 and #3

@kai-gitt kai-gitt self-assigned this Jan 7, 2024
@kai-gitt kai-gitt marked this pull request as ready for review January 10, 2024 22:46
@kai-gitt kai-gitt requested a review from zefir-git January 10, 2024 22:46
@kai-gitt kai-gitt linked an issue Jan 11, 2024 that may be closed by this pull request
Copy link
Member

@zefir-git zefir-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any way to cancel an invite?

missing final and @NotNull/@Nullable. dont think anyone wants to debug null pointer exceptions

pom.xml Outdated Show resolved Hide resolved

import java.io.File;

public enum Messages {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use FileConfiguration with saveDefault() on enable, and here we could have methods that we can add typed placeholders to like Component nationNotFound(Nation nation) -> getConfig errors.nation-not-found, Placeholder.unparsed(nation.name)

src/main/java/pro/cloudnode/smp/nations/Nations.java Outdated Show resolved Hide resolved
Comment on lines 31 to 34
if (!isPlayer()) {
sendMessage(t(Messages.ONLY_PLAYERS));
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console should also be able to create/delete/etc. nations

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nation by default is bound to a leader which is a player, force-delete might be the only one then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be useful to be able to handle all of these from console, perhaps by supplying an additional <player> arg like /nation create test Player123 or just /nation create test then /nation add Player123 and first player by default becomes leader

Comment on lines 36 to 39
if (args.length == 0) {
//@todo: send help message
sendMessage("<yellow>Usage: <white>/" + label + " [create|invite|kick|list]");
help(sender, label, args);
return;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo args length 0 should send general plugin info like version etc. and send help with /<command> help

import java.util.Objects;
import java.util.UUID;

public class Nation {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also have a description I think

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think that's displayed anywhere

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be displayed in list (maybe hover) and nation info

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you mean of the nation itself, i thought of like a javadoc class

src/main/java/pro/cloudnode/smp/nations/util/Nation.java Outdated Show resolved Hide resolved
import java.util.Objects;
import java.util.UUID;

public class NationManager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need these. These should just be static methods on Nation

import java.util.UUID;

public class NationManager {
public static HashMap<UUID, Nation> nations = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to cache nations at all

src/main/resources/plugin.yml Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Nation name & color in join/quit messages Nation name & color on tablist and in displayname
2 participants