From 40cbc6bc75759b011365b64f5c2c94f166fe1a6b Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:13:14 +0200 Subject: [PATCH 01/12] use `plugin-yml paper` plugin --- build.gradle.kts | 2 +- gradle/libs.versions.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 866d9965..d47941d9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ plugins { alias(libs.plugins.minotaur) alias(libs.plugins.shadow) alias(libs.plugins.hangar.publish.plugin) - alias(libs.plugins.plugin.yml.bukkit) + alias(libs.plugins.plugin.yml.paper) alias(libs.plugins.run.paper) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4670b1be..dbbb577a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -23,5 +23,5 @@ spotless = { id = "com.diffplug.spotless", version = "6.18.0" } minotaur = { id = "com.modrinth.minotaur", version = "2.+" } shadow = { id = "io.github.goooler.shadow", version = "8.1.7" } hangar-publish-plugin = { id = "io.papermc.hangar-publish-plugin", version = "0.1.2" } -plugin-yml-bukkit = { id = "net.minecrell.plugin-yml.bukkit", version = "0.5.3" } +plugin-yml-paper = { id = "net.minecrell.plugin-yml.paper", version = "0.6.0" } run-paper = { id = "xyz.jpenilla.run-paper", version = "2.1.0" } From d5310d4eb0c328d6a30abfddce09dc4d38f76d04 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:15:11 +0200 Subject: [PATCH 02/12] provide instead of softDepend --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index d47941d9..6d1e0522 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -75,7 +75,6 @@ bukkit { apiVersion = "1.13" depend = listOf("FastAsyncWorldEdit") website = "https://github.com/OneLiteFeatherNET/BetterGoPaint" - softDepend = listOf("goPaint") commands { register("gopaint") { @@ -83,6 +82,7 @@ bukkit { aliases = listOf("gp") } } + provides = listOf("goPaint") permissions { register("bettergopaint.command.admin.reload") { From acb9d39a824b265cb25a143a52b2435f534a5e14 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:16:45 +0200 Subject: [PATCH 03/12] bukkit to paper plugin --- build.gradle.kts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6d1e0522..4e8d73fb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ import io.papermc.hangarpublishplugin.model.Platforms import net.minecrell.pluginyml.bukkit.BukkitPluginDescription +import net.minecrell.pluginyml.paper.PaperPluginDescription import xyz.jpenilla.runpaper.task.RunServer import kotlin.system.exitProcess @@ -68,20 +69,20 @@ dependencies { annotationProcessor(libs.cloud.annotations) } -bukkit { +paper { name = "BetterGoPaint" main = "net.onelitefeather.bettergopaint.BetterGoPaint" authors = listOf("Arcaniax", "TheMeinerLP") - apiVersion = "1.13" - depend = listOf("FastAsyncWorldEdit") - website = "https://github.com/OneLiteFeatherNET/BetterGoPaint" + apiVersion = "1.20" - commands { - register("gopaint") { - description = "goPaint command" - aliases = listOf("gp") + serverDependencies { + register("FastAsyncWorldEdit") { + load = PaperPluginDescription.RelativeLoadOrder.BEFORE + required = true } } + + website = "https://github.com/OneLiteFeatherNET/BetterGoPaint" provides = listOf("goPaint") permissions { From e1282d18ccbf7795f18dffe1466039721d4daa7c Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:18:04 +0200 Subject: [PATCH 04/12] fixed startup issue --- .../bettergopaint/BetterGoPaint.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java index 54c8c70f..f787d03a 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java +++ b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java @@ -141,21 +141,17 @@ public void onEnable() { } private boolean checkIfGoPaintActive() { - if (getServer().getPluginManager().isPluginEnabled("goPaint")) { - if (PaperLib.getMinecraftVersion() > 17) { - getComponentLogger().error(MiniMessage.miniMessage().deserialize("BetterGoPaint is a replacement for goPaint. " + - "Please use one instead of both")); - getComponentLogger().error(MiniMessage.miniMessage().deserialize("This plugin is now disabling to prevent " + - "future " + - "errors")); - } else { - getSLF4JLogger().error("BetterGoPaint is a replacement for goPaint. Please use one instead of both"); - getSLF4JLogger().error("This plugin is now disabling to prevent future errors"); - } - this.getServer().getPluginManager().disablePlugin(this); - return true; + if (getServer().getPluginManager().getPlugin("goPaint") == this) { + return false; } - return false; + getComponentLogger().error(MiniMessage.miniMessage().deserialize( + "BetterGoPaint is a replacement for goPaint. Please use one instead of both" + )); + getComponentLogger().error(MiniMessage.miniMessage().deserialize( + "This plugin is now disabling to prevent future errors" + )); + + return true; } private void enableCommandSystem() { From 66ca3aa25083fe6f907296662642afdb741a5ad7 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:25:23 +0200 Subject: [PATCH 05/12] removed unnecessary checks --- .../bettergopaint/BetterGoPaint.java | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java index f787d03a..7ecd6b38 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java +++ b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java @@ -80,32 +80,22 @@ public void reload() { public void onEnable() { // Check if we are in a safe environment ServerLib.checkUnsafeForks(); - ServerLib.isJavaSixteen(); PaperLib.suggestPaper(this); - if (PaperLib.getMinecraftVersion() < 16) { - getSLF4JLogger().error("We support only Minecraft 1.16.5 upwards"); - getSLF4JLogger().error("Disabling plugin to prevent errors"); - this.getServer().getPluginManager().disablePlugin(this); - return; - } - if (PaperLib.getMinecraftVersion() == 16 && PaperLib.getMinecraftPatchVersion() < 5) { - getSLF4JLogger().error("We support only Minecraft 1.16.5 upwards"); - getSLF4JLogger().error("Disabling plugin to prevent errors"); + //noinspection UnnecessaryUnicodeEscape + getComponentLogger().info(MiniMessage.miniMessage().deserialize( + "Made with \u2665 in Germany" + )); + + // disable if goPaint and BetterGoPaint are installed simultaneously + if (hasOriginalGoPaint()) { this.getServer().getPluginManager().disablePlugin(this); return; } - if (PaperLib.getMinecraftVersion() > 17) { - getComponentLogger().info(MiniMessage - .miniMessage() - .deserialize("Made with \u2665 in Germany")); - } else { - getLogger().info("Made with \u2665 in Germany"); - } - if (checkIfGoPaintActive()) { - return; - } + getComponentLogger().info(MiniMessage.miniMessage().deserialize( + "Made with \u2665 in Germany" + )); betterGoPaint = this; if (!Files.exists(getDataFolder().toPath())) { @@ -140,7 +130,7 @@ public void onEnable() { } - private boolean checkIfGoPaintActive() { + private boolean hasOriginalGoPaint() { if (getServer().getPluginManager().getPlugin("goPaint") == this) { return false; } From 20847fd3bc198c2a5dc02ee3f562aac44c725491 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:26:32 +0200 Subject: [PATCH 06/12] extracted command registration to own method --- .../bettergopaint/BetterGoPaint.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java index 7ecd6b38..f580dcf9 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java +++ b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java @@ -107,27 +107,30 @@ public void onEnable() { } Settings.settings().reload(new File(getDataFolder(), "config.yml")); enableBStats(); - enableCommandSystem(); - if (this.annotationParser != null) { - annotationParser.parse(new ReloadCommand(this)); - } - manager = new PlayerBrushManager(); - connectListener = new ConnectListener(betterGoPaint); - interactListener = new InteractListener(betterGoPaint); - inventoryListener = new InventoryListener(betterGoPaint); - cmdHandler = new Handler(betterGoPaint); - PluginManager pm = getServer().getPluginManager(); - pm.registerEvents(connectListener, this); - pm.registerEvents(interactListener, this); - pm.registerEvents(inventoryListener, this); - pm.registerEvents(cmdHandler, this); - getCommand("gopaint").setExecutor(cmdHandler); + registerListeners(); + registerCommands(); DisabledBlocks.addBlocks(); + } + @SuppressWarnings("UnstableApiUsage") + private void registerCommands() { + Bukkit.getCommandMap().register("gopaint", getPluginMeta().getName(), new GoPaintCommand(this)); + var annotationParser = enableCommandSystem(); + if (annotationParser != null) { + annotationParser.parse(new ReloadCommand(this)); + annotationParser.parse(new GoPaintCommand(this)); + } + } + + private void registerListeners() { + PluginManager pm = getServer().getPluginManager(); + pm.registerEvents(new ConnectListener(this), this); + pm.registerEvents(new InteractListener(this), this); + pm.registerEvents(new InventoryListener(this), this); } private boolean hasOriginalGoPaint() { @@ -144,7 +147,7 @@ private boolean hasOriginalGoPaint() { return true; } - private void enableCommandSystem() { + private @Nullable AnnotationParser enableCommandSystem() { try { LegacyPaperCommandManager commandManager = LegacyPaperCommandManager.createNative( this, @@ -154,12 +157,12 @@ private void enableCommandSystem() { commandManager.registerBrigadier(); getLogger().info("Brigadier support enabled"); } - this.annotationParser = new AnnotationParser<>(commandManager, CommandSender.class); + return new AnnotationParser<>(commandManager, CommandSender.class); } catch (Exception e) { getLogger().log(Level.SEVERE, "Cannot init command manager"); + return null; } - } private void enableBStats() { From 1565a937d6f3e460e0719c2ac0ef08d4027897ab Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:29:03 +0200 Subject: [PATCH 07/12] refactored command to use direct command map registration --- .../bettergopaint/command/GoPaintCommand.java | 134 ++++++++++++++++++ .../bettergopaint/command/Handler.java | 116 --------------- 2 files changed, 134 insertions(+), 116 deletions(-) create mode 100644 src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java delete mode 100644 src/main/java/net/onelitefeather/bettergopaint/command/Handler.java diff --git a/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java b/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java new file mode 100644 index 00000000..1b25139e --- /dev/null +++ b/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java @@ -0,0 +1,134 @@ +/* + * goPaint is designed to simplify painting inside of Minecraft. + * Copyright (C) Arcaniax-Development + * Copyright (C) Arcaniax team and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.onelitefeather.bettergopaint.command; + +import net.kyori.adventure.text.minimessage.MiniMessage; +import net.onelitefeather.bettergopaint.BetterGoPaint; +import net.onelitefeather.bettergopaint.objects.other.Settings; +import net.onelitefeather.bettergopaint.objects.player.PlayerBrush; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.command.PluginIdentifiableCommand; +import org.bukkit.entity.Player; +import org.bukkit.plugin.Plugin; +import org.jetbrains.annotations.NotNull; + +public class GoPaintCommand extends Command implements PluginIdentifiableCommand { + + public static BetterGoPaint plugin; + + public GoPaintCommand(BetterGoPaint main) { + super("gopaint"); + plugin = main; + } + + @Override + public boolean execute( + @NotNull final CommandSender sender, + @NotNull final String commandLabel, + final @NotNull String[] args + ) { + if (!(sender instanceof final Player p)) { + return false; + } + PlayerBrush pb = BetterGoPaint.getBrushManager().getPlayerBrush(p); + String prefix = Settings.settings().generic.PREFIX; + if (!p.hasPermission("bettergopaint.use")) { + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "You are lacking the permission bettergopaint" + + ".use")); + return true; + } + if (args.length == 0) { + if (p.hasPermission("bettergopaint.admin")) { + p.sendMessage(MiniMessage + .miniMessage() + .deserialize(prefix + "/gp size|toggle|info|reload")); + return true; + } + p.sendMessage(MiniMessage + .miniMessage() + .deserialize(prefix + "/gp size|toggle|info")); + return true; + } else if (args.length == 1) { + if (args[0].equalsIgnoreCase("size")) { + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size [number]")); + return true; + } else if (args[0].equalsIgnoreCase("toggle")) { + if (pb.isEnabled()) { + pb.toggleEnabled(); + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Disabled brush")); + } else { + pb.toggleEnabled(); + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Enabled brush")); + } + return true; + } else if ((args[0].equalsIgnoreCase("reload") || args[0].equalsIgnoreCase("r")) && p.hasPermission( + "bettergopaint.admin")) { + plugin.reload(); + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Reloaded")); + return true; + } else if (args[0].equalsIgnoreCase("info") || args[0].equalsIgnoreCase("i")) { + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Created by: TheMeinerLP")); + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Links: Twitter")); + return true; + } + if (p.hasPermission("bettergopaint.admin")) { + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info" + + "" + + "|reload")); + return true; + } + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info")); + return true; + } else if (args.length == 2) { + if (args[0].equalsIgnoreCase("size") || args[0].equalsIgnoreCase("s")) { + try { + int sizeAmount = Integer.parseInt(args[1]); + pb.setBrushSize(sizeAmount); + p.sendMessage(MiniMessage + .miniMessage() + .deserialize(prefix + "Size set to: " + pb.getBrushSize())); + return true; + } catch (Exception e) { + p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gb size [number]")); + return true; + } + } + if (p.hasPermission("bettergopaint.admin")) { + p.sendMessage(MiniMessage + .miniMessage() + .deserialize(prefix + "/gp size|toggle|info|reload")); + return true; + } + p.sendMessage(MiniMessage + .miniMessage() + .deserialize(prefix + "/gp size|toggle|info")); + return true; + } + return false; + } + + @Override + public @NotNull Plugin getPlugin() { + return plugin; + } + +} diff --git a/src/main/java/net/onelitefeather/bettergopaint/command/Handler.java b/src/main/java/net/onelitefeather/bettergopaint/command/Handler.java deleted file mode 100644 index 3285d2c6..00000000 --- a/src/main/java/net/onelitefeather/bettergopaint/command/Handler.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * goPaint is designed to simplify painting inside of Minecraft. - * Copyright (C) Arcaniax-Development - * Copyright (C) Arcaniax team and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package net.onelitefeather.bettergopaint.command; - -import net.onelitefeather.bettergopaint.BetterGoPaint; -import net.onelitefeather.bettergopaint.objects.other.Settings; -import net.onelitefeather.bettergopaint.objects.player.PlayerBrush; -import net.kyori.adventure.text.minimessage.MiniMessage; -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.event.Listener; - -public class Handler implements Listener, CommandExecutor { - - public static BetterGoPaint plugin; - - public Handler(BetterGoPaint main) { - plugin = main; - } - - @Override - public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (cmd.getName().equalsIgnoreCase("gopaint") || cmd.getName().equalsIgnoreCase("gp")) { - if (!(sender instanceof Player)) { - return false; - } - Player p = (Player) sender; - PlayerBrush pb = BetterGoPaint.getBrushManager().getPlayerBrush(p); - String prefix = Settings.settings().GENERIC.PREFIX; - if (!p.hasPermission("bettergopaint.use")) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "You are lacking the permission bettergopaint" + - ".use")); - return true; - } - if (args.length == 0) { - if (p.hasPermission("bettergopaint.admin")) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info|reload")); - return true; - } - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info")); - return true; - } else if (args.length == 1) { - if (args[0].equalsIgnoreCase("size")) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size [number]")); - return true; - } else if (args[0].equalsIgnoreCase("toggle")) { - if (pb.isEnabled()) { - pb.toggleEnabled(); - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Disabled brush")); - } else { - pb.toggleEnabled(); - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Enabled brush")); - } - return true; - } else if ((args[0].equalsIgnoreCase("reload") || args[0].equalsIgnoreCase("r")) && p.hasPermission( - "bettergopaint.admin")) { - plugin.reload(); - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Reloaded")); - return true; - } else if (args[0].equalsIgnoreCase("info") || args[0].equalsIgnoreCase("i")) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix+ "Created by: TheMeinerLP")); - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix+ "Links: Twitter")); - return true; - } - if (p.hasPermission("bettergopaint.admin")) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info" + - "" + - "|reload")); - return true; - } - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info")); - return true; - } else if (args.length == 2) { - if (args[0].equalsIgnoreCase("size") || args[0].equalsIgnoreCase("s")) { - try { - int sizeAmount = Integer.parseInt(args[1]); - pb.setBrushSize(sizeAmount); - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "Size set to: " + pb.getBrushSize())); - return true; - } catch (Exception e) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gb size [number]")); - return true; - } - } - if (p.hasPermission("bettergopaint.admin")) { - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info|reload")); - return true; - } - p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "/gp size|toggle|info")); - return true; - } - } - return false; - } - -} From ae4408624b1508abe9b0bc71c1d6ced7d93a0ecb Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:30:12 +0200 Subject: [PATCH 08/12] updated imports --- .../java/net/onelitefeather/bettergopaint/BetterGoPaint.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java index f580dcf9..7a34d017 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java +++ b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java @@ -21,7 +21,7 @@ import com.fastasyncworldedit.core.Fawe; import io.papermc.lib.PaperLib; import net.kyori.adventure.text.minimessage.MiniMessage; -import net.onelitefeather.bettergopaint.command.Handler; +import net.onelitefeather.bettergopaint.command.GoPaintCommand; import net.onelitefeather.bettergopaint.command.ReloadCommand; import net.onelitefeather.bettergopaint.listeners.ConnectListener; import net.onelitefeather.bettergopaint.listeners.InteractListener; @@ -32,6 +32,7 @@ import net.onelitefeather.bettergopaint.utils.DisabledBlocks; import org.bstats.bukkit.Metrics; import org.bstats.charts.SimplePie; +import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.bukkit.event.Listener; import org.bukkit.plugin.PluginManager; @@ -41,6 +42,7 @@ import org.incendo.cloud.execution.ExecutionCoordinator; import org.incendo.cloud.paper.LegacyPaperCommandManager; import org.incendo.serverlib.ServerLib; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.IOException; From 7a3b8edbd63783c30b8f615623e0b417e82a24d3 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:30:56 +0200 Subject: [PATCH 09/12] removed unused fields --- .../java/net/onelitefeather/bettergopaint/BetterGoPaint.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java index 7a34d017..30a7c647 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java +++ b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java @@ -55,11 +55,6 @@ public class BetterGoPaint extends JavaPlugin implements Listener { public static boolean plotSquaredEnabled; private static PlayerBrushManager manager; private static BetterGoPaint betterGoPaint; - public ConnectListener connectListener; - public InteractListener interactListener; - public InventoryListener inventoryListener; - public Handler cmdHandler; - private AnnotationParser annotationParser; public static BetterGoPaint getGoPaintPlugin() { return betterGoPaint; From 8bb6505947cb2c5c0f6106d9df97ba7f8ec91599 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:31:32 +0200 Subject: [PATCH 10/12] fixed filed name --- .../onelitefeather/bettergopaint/command/GoPaintCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java b/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java index 1b25139e..6d513c87 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java +++ b/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java @@ -48,7 +48,7 @@ public boolean execute( return false; } PlayerBrush pb = BetterGoPaint.getBrushManager().getPlayerBrush(p); - String prefix = Settings.settings().generic.PREFIX; + String prefix = Settings.settings().GENERIC.PREFIX; if (!p.hasPermission("bettergopaint.use")) { p.sendMessage(MiniMessage.miniMessage().deserialize(prefix + "You are lacking the permission bettergopaint" + ".use")); From 4aa380a252822c7a2ea99f566ca2d38a461dde01 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:39:59 +0200 Subject: [PATCH 11/12] added back description usage and alias --- .../onelitefeather/bettergopaint/command/GoPaintCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java b/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java index 6d513c87..f7d145d9 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java +++ b/src/main/java/net/onelitefeather/bettergopaint/command/GoPaintCommand.java @@ -29,12 +29,14 @@ import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; +import java.util.List; + public class GoPaintCommand extends Command implements PluginIdentifiableCommand { public static BetterGoPaint plugin; public GoPaintCommand(BetterGoPaint main) { - super("gopaint"); + super("gopaint", "goPaint command", "/gp size|toggle|info|reload", List.of("gp")); plugin = main; } From ede916b5ec37401915cb6416317891f7ca5a18f6 Mon Sep 17 00:00:00 2001 From: david Date: Sat, 8 Jun 2024 00:43:13 +0200 Subject: [PATCH 12/12] removed duplicate log --- .../net/onelitefeather/bettergopaint/BetterGoPaint.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java index 30a7c647..9050ad75 100644 --- a/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java +++ b/src/main/java/net/onelitefeather/bettergopaint/BetterGoPaint.java @@ -79,17 +79,13 @@ public void onEnable() { ServerLib.checkUnsafeForks(); PaperLib.suggestPaper(this); - //noinspection UnnecessaryUnicodeEscape - getComponentLogger().info(MiniMessage.miniMessage().deserialize( - "Made with \u2665 in Germany" - )); - // disable if goPaint and BetterGoPaint are installed simultaneously if (hasOriginalGoPaint()) { this.getServer().getPluginManager().disablePlugin(this); return; } + //noinspection UnnecessaryUnicodeEscape getComponentLogger().info(MiniMessage.miniMessage().deserialize( "Made with \u2665 in Germany" ));