Merge pull request #58 from Badbird5907/master
Accidentally pushed to my own repo
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
|
id("net.nuggetmc.java-conventions")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "net.nuggetmc"
|
group = "net.nuggetmc"
|
||||||
version = "3.3.1-BETA"
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
id("io.papermc.paperweight.userdev") version "1.3.7"
|
id("io.papermc.paperweight.userdev") version "1.3.7"
|
||||||
|
id("net.nuggetmc.java-conventions")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "net.nuggetmc"
|
group = "net.nuggetmc"
|
||||||
version = "3.3.1-BETA"
|
|
||||||
description = "TerminatorPlus"
|
description = "TerminatorPlus"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
|
|||||||
@@ -233,18 +233,21 @@ public class BotCommand extends CommandInstance {
|
|||||||
public List<String> infoAutofill(CommandSender sender, String[] args) {
|
public List<String> infoAutofill(CommandSender sender, String[] args) {
|
||||||
return args.length == 2 ? manager.fetchNames() : null;
|
return args.length == 2 ? manager.fetchNames() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
name = "count",
|
name = "count",
|
||||||
desc = "Counts the amount of bots on screen by name."
|
desc = "Counts the amount of bots on screen by name.",
|
||||||
|
aliases = {
|
||||||
|
"list"
|
||||||
|
}
|
||||||
)
|
)
|
||||||
public void count(CommandSender sender) {
|
public void count(CommandSender sender) {
|
||||||
List<String> names = manager.fetchNames();
|
List<String> names = manager.fetchNames();
|
||||||
Map<String, Integer> freqMap = names.stream().collect(Collectors.toMap(s -> s, s -> 1, Integer::sum));
|
Map<String, Integer> freqMap = names.stream().collect(Collectors.toMap(s -> s, s -> 1, Integer::sum));
|
||||||
List<Entry<String, Integer>> entries = freqMap.entrySet().stream()
|
List<Entry<String, Integer>> entries = freqMap.entrySet().stream()
|
||||||
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList());
|
.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()
|
entries.forEach(en -> sender.sendMessage(ChatColor.GREEN + en.getKey()
|
||||||
+ ChatColor.RESET + " - " + ChatColor.BLUE + en.getValue().toString() + ChatColor.RESET));
|
+ ChatColor.RESET + " - " + ChatColor.BLUE + en.getValue().toString() + ChatColor.RESET));
|
||||||
sender.sendMessage("Total bots: " + ChatColor.BLUE + freqMap.values().stream().reduce(0, Integer::sum) + 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) {
|
public void debug(CommandSender sender, @Arg("expression") String expression) {
|
||||||
new Debugger(sender).execute(expression);
|
new Debugger(sender).execute(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double parseDoubleOrRelative(String pos, Location loc, int type) {
|
private double parseDoubleOrRelative(String pos, Location loc, int type) {
|
||||||
if (loc == null || pos.length() == 0 || pos.charAt(0) != '~')
|
if (loc == null || pos.length() == 0 || pos.charAt(0) != '~')
|
||||||
return Double.parseDouble(pos);
|
return Double.parseDouble(pos);
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("java")
|
id("java")
|
||||||
|
id("net.nuggetmc.java-conventions")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "net.nuggetmc"
|
|
||||||
version = "3.3.1-BETA"
|
|
||||||
|
|
||||||
val jarName = "TerminatorPlus-" + version;
|
val jarName = "TerminatorPlus-" + version;
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
11
buildSrc/build.gradle.kts
Normal file
11
buildSrc/build.gradle.kts
Normal 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 {
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
plugins {
|
||||||
|
`java-library`
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "net.nuggetmc"
|
||||||
|
version = "4.0.0-BETA"
|
||||||
@@ -8,3 +8,5 @@ pluginManagement {
|
|||||||
rootProject.name = "TerminatorPlus"
|
rootProject.name = "TerminatorPlus"
|
||||||
include("TerminatorPlus-Plugin")
|
include("TerminatorPlus-Plugin")
|
||||||
include("TerminatorPlus-API")
|
include("TerminatorPlus-API")
|
||||||
|
|
||||||
|
// set the version
|
||||||
|
|||||||
Reference in New Issue
Block a user