From e65b484251de9c05d9e35cd0ff66f476c26fd4c8 Mon Sep 17 00:00:00 2001
From: frqnny <45723631+frqnny@users.noreply.github.com>
Date: Wed, 15 Jun 2022 22:58:28 -0400
Subject: [PATCH 1/4] Fix compile errors and update
---
.gitignore | 1 +
pom.xml | 6 +++++-
velocity/pom.xml | 2 +-
.../donationstore/velocity/DonationStorePlugin.java | 11 ++++++++---
.../velocity/commands/DonationStoreCommand.java | 8 ++++++--
.../java/net/donationstore/velocity/logging/Log.java | 11 ++++++-----
6 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/.gitignore b/.gitignore
index 00a6ab3..e45e86d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
*.iml
target
.DS_Store
+/.idea/
diff --git a/pom.xml b/pom.xml
index 24d76d7..924e63c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,11 +38,15 @@
Sponge Maven Repository
https://repo.spongepowered.org/maven
+
+ papermc
+ https://repo.papermc.io/repository/maven-public/
+
1.14-SNAPSHOT
- 1.0.0-SNAPSHOT
+ 3.1.2-SNAPSHOT
1.2.3
diff --git a/velocity/pom.xml b/velocity/pom.xml
index ca6d9f8..b48a12e 100644
--- a/velocity/pom.xml
+++ b/velocity/pom.xml
@@ -10,7 +10,7 @@
4.0.0
donation-store-velocity
- 2.2
+ 2.3
diff --git a/velocity/src/main/java/net/donationstore/velocity/DonationStorePlugin.java b/velocity/src/main/java/net/donationstore/velocity/DonationStorePlugin.java
index 9fa2af8..ad28f45 100644
--- a/velocity/src/main/java/net/donationstore/velocity/DonationStorePlugin.java
+++ b/velocity/src/main/java/net/donationstore/velocity/DonationStorePlugin.java
@@ -2,6 +2,7 @@
import com.google.inject.Inject;
import com.moandjiezana.toml.Toml;
+import com.velocitypowered.api.command.CommandMeta;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
import com.velocitypowered.api.event.proxy.ProxyShutdownEvent;
@@ -17,7 +18,7 @@
import java.nio.file.Path;
-@Plugin(id = "donationstore", name = "Donation-Store-Velocity", version = "2.2", authors = {"Donation Store"})
+@Plugin(id = "donationstore", name = "Donation-Store-Velocity", version = "2.3", authors = {"Donation Store"})
public class DonationStorePlugin {
private ProxyServer server;
@@ -33,7 +34,7 @@ public DonationStorePlugin(ProxyServer server, @DataDirectory Path dataDirectory
this.dataDirectory = dataDirectory;
- Log.toConsole(String.format(Logging.enableLog(), "Velocity", "v2.2"));
+ Log.toConsole(String.format(Logging.enableLog(), "Velocity", "v2.3"));
}
@Subscribe
@@ -46,7 +47,11 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
fileConfiguration.save();
}
- server.getCommandManager().register(new DonationStoreCommand(fileConfiguration), "ds");
+ CommandMeta dsMeta = server.getCommandManager().metaBuilder("ds")
+ .plugin(this)
+ .build();
+
+ server.getCommandManager().register(dsMeta, new DonationStoreCommand(fileConfiguration));
queueTask.run(fileConfiguration, this);
} catch(Exception exception) {
diff --git a/velocity/src/main/java/net/donationstore/velocity/commands/DonationStoreCommand.java b/velocity/src/main/java/net/donationstore/velocity/commands/DonationStoreCommand.java
index 6cfb6f2..50a1233 100644
--- a/velocity/src/main/java/net/donationstore/velocity/commands/DonationStoreCommand.java
+++ b/velocity/src/main/java/net/donationstore/velocity/commands/DonationStoreCommand.java
@@ -2,6 +2,7 @@
import com.velocitypowered.api.command.Command;
import com.velocitypowered.api.command.CommandSource;
+import com.velocitypowered.api.command.SimpleCommand;
import com.velocitypowered.api.proxy.Player;
import net.donationstore.commands.CommandFactory;
import net.donationstore.velocity.config.FileConfiguration;
@@ -13,7 +14,7 @@
import java.util.Collections;
import java.util.List;
-public class DonationStoreCommand implements Command {
+public class DonationStoreCommand implements SimpleCommand {
private FileConfiguration fileConfiguration;
private CommandFactory commandFactory;
@@ -24,7 +25,10 @@ public DonationStoreCommand(FileConfiguration configuration) {
}
@Override
- public void execute(@NonNull CommandSource commandSender, String[] strings) {
+ public void execute(Invocation invocation) {
+ CommandSource commandSender = invocation.source();
+ String[] strings = invocation.arguments();
+
if(strings.length < 1) {
Log.send(commandSender, "Webstore and Helpdesk for Game Servers");
Log.send(commandSender, "Velocity Plugin - Version 2.2");
diff --git a/velocity/src/main/java/net/donationstore/velocity/logging/Log.java b/velocity/src/main/java/net/donationstore/velocity/logging/Log.java
index 1364b50..93f62a7 100644
--- a/velocity/src/main/java/net/donationstore/velocity/logging/Log.java
+++ b/velocity/src/main/java/net/donationstore/velocity/logging/Log.java
@@ -2,8 +2,10 @@
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.proxy.Player;
-import net.kyori.text.TextComponent;
-import net.kyori.text.format.TextColor;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.TextComponent;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.format.TextColor;
import java.util.List;
@@ -11,9 +13,8 @@ public class Log {
public static void send(CommandSource sender, String log) {
if (sender instanceof Player) {
- TextComponent message = TextComponent.builder("[Donation Store]").color(TextColor.GREEN)
- .append(TextComponent.builder(String.format(": %s", log)).color(TextColor.WHITE).build())
- .build();
+ TextComponent message = Component.text("[Donation Store]").color(NamedTextColor.GREEN)
+ .append(Component.text(String.format(": %s", log)).color(NamedTextColor.WHITE));
sender.sendMessage(message);
} else {
From 8990b2fda4ca21ee059ae081cdf0683b74af246b Mon Sep 17 00:00:00 2001
From: frqnny <45723631+frqnny@users.noreply.github.com>
Date: Wed, 15 Jun 2022 23:03:25 -0400
Subject: [PATCH 2/4] Oops, fix another one
---
.../main/java/net/donationstore/velocity/queue/QueueTask.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/velocity/src/main/java/net/donationstore/velocity/queue/QueueTask.java b/velocity/src/main/java/net/donationstore/velocity/queue/QueueTask.java
index 07240dc..29b40fe 100644
--- a/velocity/src/main/java/net/donationstore/velocity/queue/QueueTask.java
+++ b/velocity/src/main/java/net/donationstore/velocity/queue/QueueTask.java
@@ -69,6 +69,6 @@ public void run() {
}
public void runCommand(DonationStorePlugin plugin, String command) {
- plugin.getServer().getCommandManager().execute(plugin.getServer().getConsoleCommandSource(), command);
+ plugin.getServer().getCommandManager().executeAsync(plugin.getServer().getConsoleCommandSource(), command);
}
}
From 36cefcbe06589fc3f4a7bb11e2eb067813beb3b7 Mon Sep 17 00:00:00 2001
From: snyk-bot
Date: Wed, 17 May 2023 14:40:10 +0000
Subject: [PATCH 3/4] fix: pom.xml & velocity/pom.xml to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-2326698
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-2421244
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038424
- https://snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038426
- https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEGUAVA-1015415
- https://snyk.io/vuln/SNYK-JAVA-COMGOOGLEGUAVA-32236
---
pom.xml | 2 +-
velocity/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 924e63c..56e5a2c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,7 +104,7 @@
com.fasterxml.jackson.datatype
jackson-datatype-jdk8
- 2.10.3
+ 2.13.5
org.apache.commons
diff --git a/velocity/pom.xml b/velocity/pom.xml
index b48a12e..cb8c601 100644
--- a/velocity/pom.xml
+++ b/velocity/pom.xml
@@ -25,7 +25,7 @@
org.spongepowered
configurate-core
- 3.6
+ 4.0.0
compile
From 310e37c2ca609db26b5defc985178e27b3b4e85f Mon Sep 17 00:00:00 2001
From: snyk-bot
Date: Wed, 17 May 2023 14:41:23 +0000
Subject: [PATCH 4/4] fix: pom.xml to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JAVA-COMSQUAREUPOKHTTP3-2958044
- https://snyk.io/vuln/SNYK-JAVA-ORGJETBRAINSKOTLIN-2628385
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 56e5a2c..a4031e3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,7 @@
com.squareup.okhttp3
okhttp
- 4.4.1
+ 4.10.0