Skip to content

Add QOL Improvements#2

Open
kokumaji wants to merge 8 commits into
masterfrom
feat/kokumaji/qol-improvements
Open

Add QOL Improvements#2
kokumaji wants to merge 8 commits into
masterfrom
feat/kokumaji/qol-improvements

Conversation

@kokumaji

@kokumaji kokumaji commented May 27, 2021

Copy link
Copy Markdown
  • Adds a /kit <kit> command to make it easier to select a preferred kit
  • Adds a /ready command to make it easier to toggle the team ready state
  • Adds a /scenarios vote <scenario> command to make it easier to vote for a specific scenario

This also includes small additions/tweaks to the API to allow the above features to run smoothly

QOL Improvemnts suggested by Stixil #1

@kokumaji kokumaji requested review from kaylendog and vladfrangu May 27, 2021 10:56

@kaylendog kaylendog left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This Gradle version is severely out of date. We should be using at least Gradle 9.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I would agree, but since this is voluntary work I do not care about updating my stuff to latest. Can break stuff in production anyway. Our system is still on 1.16..

@@ -0,0 +1,81 @@
package com.gmail.val59000mc.commands;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What on earth is this package name???

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is the commands subpackage, where all commands are stored.....

Comment on lines +42 to +61
if(gameManager.getGameState().equals(GameState.WAITING)) {
String kitName = String.join(" ", args);
Kit kit = KitsManager.getKitByArgument(kitName);
if(kit == null) {
player.sendMessage(Lang.COMMAND_KIT_DOESNT_EXIST);
return true;
}

UhcPlayer uhcPlayer = playerManager.getUhcPlayer(player);

if(kit.canBeUsedBy(player, config)) {
uhcPlayer.setKit(kit);
uhcPlayer.sendMessage(Lang.ITEMS_KIT_SELECTED.replace("%kit%", kit.getName()));
} else {
uhcPlayer.sendMessage(Lang.ITEMS_KIT_NO_PERMISSION);
}

}

return true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Invert this condition and use a guard clause.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ok

Comment on lines +67 to +77
List<String> options = new ArrayList<>();

if(args.length == 1) {
if(!args[0].equals("")) {
for(Kit kit : KitsManager.getKits()) {
if(kit.getName().toLowerCase().startsWith(args[0].toLowerCase())) options.add(kit.getName());
}
} else {
options = KitsManager.getKits().stream().map(Kit::getName).collect(Collectors.toList());
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

De-nest and use guard clauses.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will guard you

return options;
}

} No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No newline at EOF.

Comment thread build.gradle
Comment on lines +25 to +26
sourceCompatibility = 11
targetCompatibility = 11

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is 10 major versions behind, are you okay?

Comment thread build.gradle
@@ -64,18 +70,25 @@ dependencies {
//shadow 'org.spigotmc:spigot-api:1.15.2-R0.1-SNAPSHOT'
shadow 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please target latest minecraft, 1.21.10

Comment thread build.gradle
minimize()
}

build.dependsOn(shadowJar) No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No newline at EOF

Comment thread gradle.properties
@@ -1,2 +1,2 @@
pluginGroup=com.gmail.val59000mc
pluginVersion=1.19.2 No newline at end of file
pluginVersion=1.20.0 No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No newline at EOF.

Comment thread gradlew

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

...why is the heap only 64m big???? this review is a joke, but how did this ever work???

@kaylendog kaylendog removed the request for review from vladfrangu November 7, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants