Merge pull request #58 from Badbird5907/master

Accidentally pushed to my own repo
This commit is contained in:
Badbird5907
2023-01-05 19:52:58 -05:00
committed by GitHub
7 changed files with 31 additions and 11 deletions

View File

@@ -1,9 +1,9 @@
plugins {
id("java")
id("net.nuggetmc.java-conventions")
}
group = "net.nuggetmc"
version = "3.3.1-BETA"
repositories {
mavenCentral()

View File

@@ -1,10 +1,10 @@
plugins {
`java-library`
id("io.papermc.paperweight.userdev") version "1.3.7"
id("net.nuggetmc.java-conventions")
}
group = "net.nuggetmc"
version = "3.3.1-BETA"
description = "TerminatorPlus"
java {

View File

@@ -233,18 +233,21 @@ public class BotCommand extends CommandInstance {
public List<String> infoAutofill(CommandSender sender, String[] args) {
return args.length == 2 ? manager.fetchNames() : null;
}
@Command(
name = "count",
desc = "Counts the amount of bots on screen by name."
name = "count",
desc = "Counts the amount of bots on screen by name.",
aliases = {
"list"
}
)
public void count(CommandSender sender) {
List<String> names = manager.fetchNames();
Map<String, Integer> freqMap = names.stream().collect(Collectors.toMap(s -> s, s -> 1, Integer::sum));
List<Entry<String, Integer>> entries = freqMap.entrySet().stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
sender.sendMessage(ChatUtils.LINE);
sender.sendMessage(ChatUtils.LINE);
entries.forEach(en -> sender.sendMessage(ChatColor.GREEN + en.getKey()
+ ChatColor.RESET + " - " + ChatColor.BLUE + en.getValue().toString() + ChatColor.RESET));
sender.sendMessage("Total bots: " + ChatColor.BLUE + freqMap.values().stream().reduce(0, Integer::sum) + ChatColor.RESET);
@@ -519,7 +522,7 @@ public class BotCommand extends CommandInstance {
public void debug(CommandSender sender, @Arg("expression") String expression) {
new Debugger(sender).execute(expression);
}
private double parseDoubleOrRelative(String pos, Location loc, int type) {
if (loc == null || pos.length() == 0 || pos.charAt(0) != '~')
return Double.parseDouble(pos);

View File

@@ -1,10 +1,8 @@
plugins {
id("java")
id("net.nuggetmc.java-conventions")
}
group = "net.nuggetmc"
version = "3.3.1-BETA"
val jarName = "TerminatorPlus-" + version;
repositories {

11
buildSrc/build.gradle.kts Normal file
View File

@@ -0,0 +1,11 @@
plugins {
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
`kotlin-dsl`
}
repositories {
// Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal()
}
dependencies {
}

View File

@@ -0,0 +1,6 @@
plugins {
`java-library`
}
group = "net.nuggetmc"
version = "4.0.0-BETA"

View File

@@ -8,3 +8,5 @@ pluginManagement {
rootProject.name = "TerminatorPlus"
include("TerminatorPlus-Plugin")
include("TerminatorPlus-API")
// set the version