Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.iml
target
.DS_Store
/.idea/
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@
<name>Sponge Maven Repository</name>
<url>https://repo.spongepowered.org/maven</url>
</repository>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>

<properties>
<bungeecord.version>1.14-SNAPSHOT</bungeecord.version>
<velocity.version>1.0.0-SNAPSHOT</velocity.version>
<velocity.version>3.1.2-SNAPSHOT</velocity.version>
<logback.version>1.2.3</logback.version>
</properties>

Expand All @@ -52,7 +56,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.4.1</version>
<version>4.10.0</version>
</dependency>

<!-- BungeeCord -->
Expand Down Expand Up @@ -100,7 +104,7 @@
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.10.3</version>
<version>2.13.5</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
4 changes: 2 additions & 2 deletions velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>donation-store-velocity</artifactId>
<version>2.2</version>
<version>2.3</version>

<dependencies>
<!-- Velocity -->
Expand All @@ -25,7 +25,7 @@
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>configurate-core</artifactId>
<version>3.6</version>
<version>4.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

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;

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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}