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
4 changes: 2 additions & 2 deletions bukkit-post-1.13/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,7 +20,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.2.4</version>
<configuration>
<artifactSet>
<excludes>
Expand Down
4 changes: 2 additions & 2 deletions bukkit-pre-1.13/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,7 +20,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.2.4</version>
<configuration>
<artifactSet>
<excludes>
Expand Down
4 changes: 2 additions & 2 deletions bukkit-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.19.Final</version>
<version>4.1.63.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
10 changes: 5 additions & 5 deletions bungeecord/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -28,7 +28,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.2.4</version>
<configuration>
<artifactSet>
<excludes>
Expand Down Expand Up @@ -77,19 +77,19 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.21</version>
<version>1.7.30</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.12-SNAPSHOT</version>
<version>1.16-R0.5-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.19.Final</version>
<version>4.1.63.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
8 changes: 4 additions & 4 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -14,13 +14,13 @@
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.5.0</version>
<version>2.9.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.5.0</version>
<version>2.9.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -32,7 +32,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions nukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -21,7 +21,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.2.4</version>
<configuration>
<artifactSet>
<excludes>
Expand Down
4 changes: 2 additions & 2 deletions plugin-shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>net.buycraft</groupId>
<artifactId>BuycraftX</artifactId>
<packaging>pom</packaging>
<version>12.0.7</version>
<version>12.1.0</version>
<modules>
<module>common</module>
<module>bukkit-shared</module>
Expand Down Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.2</version>
<version>20.1.0</version>
</dependency>
</dependencies>

Expand All @@ -51,7 +51,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
Expand Down
6 changes: 3 additions & 3 deletions sponge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.2.4</version>
<configuration>
<artifactSet>
<excludes>
Expand Down Expand Up @@ -119,7 +119,7 @@
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>7.0.0</version>
<version>7.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>BuycraftX</artifactId>
<groupId>net.buycraft</groupId>
<version>12.0.7</version>
<version>12.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<repositories>
<repository>
<id>velocity</id>
<url>https://repo.velocitypowered.com/snapshots/</url>
<url>https://nexus.velocitypowered.com/repository/maven-public/</url>
</repository>
</repositories>

Expand All @@ -30,7 +30,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.2.4</version>
<configuration>
<artifactSet>
<excludes>
Expand Down Expand Up @@ -127,7 +127,7 @@
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package net.buycraft.plugin.velocity;

import com.velocitypowered.api.command.Command;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.command.SimpleCommand;
import net.buycraft.plugin.velocity.command.Subcommand;
import net.kyori.text.TextComponent;
import net.kyori.text.format.TextColor;
import net.kyori.text.format.TextDecoration;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;

public class BuycraftCommand implements Command {
public class BuycraftCommand implements SimpleCommand {
private final Map<String, Subcommand> subcommandMap = new LinkedHashMap<>();
private final BuycraftPlugin plugin;

Expand All @@ -20,9 +20,11 @@ public BuycraftCommand(BuycraftPlugin plugin) {
}

@Override
public void execute(CommandSource sender, String[] args) {
public void execute(Invocation invocation) {
CommandSource sender = invocation.source();
String[] args = invocation.arguments();
if (!sender.hasPermission("buycraft.admin")) {
sender.sendMessage(TextComponent.of(plugin.getI18n().get("no_permission")).color(TextColor.RED));
sender.sendMessage(Component.text(plugin.getI18n().get("no_permission"), NamedTextColor.RED));
return;
}

Expand All @@ -43,9 +45,9 @@ public void execute(CommandSource sender, String[] args) {
}

private void showHelp(CommandSource sender) {
sender.sendMessage(TextComponent.of(plugin.getI18n().get("usage")).color(TextColor.DARK_AQUA).decoration(TextDecoration.BOLD, true));
sender.sendMessage(Component.text(plugin.getI18n().get("usage"), NamedTextColor.DARK_AQUA, TextDecoration.BOLD));
for (Map.Entry<String, Subcommand> entry : subcommandMap.entrySet()) {
sender.sendMessage(TextComponent.of("/tebex " + entry.getKey()).color(TextColor.GREEN).append(TextComponent.of(": " + entry.getValue().getDescription())));
sender.sendMessage(Component.text("/tebex " + entry.getKey(), NamedTextColor.GREEN).append(Component.text(": " + entry.getValue().getDescription(), NamedTextColor.GRAY)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void onEnable(ProxyInitializeEvent event) {
command.getSubcommandMap().put("info", new InformationSubcommand(this));
command.getSubcommandMap().put("report", new ReportCommand(this));
command.getSubcommandMap().put("coupon", new CouponSubcommand(this));
getServer().getCommandManager().register(command, "tebex", "buycraft");
server.getCommandManager().register(server.getCommandManager().metaBuilder("buycraft").aliases("tebex").build(), command);

// Send data to Keen IO
if (serverInformation != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

public class VelocityBuycraftPlatform implements IBuycraftPlatform {

private Map<Level, Function<Logger, BiConsumer<String, Throwable>>> LOG_LEVEL_MAP = new HashMap<Level, Function<Logger, BiConsumer<String, Throwable>>>() {{
private final Map<Level, Function<Logger, BiConsumer<String, Throwable>>> LOG_LEVEL_MAP = new HashMap<Level, Function<Logger, BiConsumer<String, Throwable>>>() {{
put(Level.INFO, l -> l::info);
put(Level.WARNING, l -> l::warn);
put(Level.SEVERE, l -> l::error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import net.buycraft.plugin.data.Coupon;
import net.buycraft.plugin.shared.util.CouponUtil;
import net.buycraft.plugin.velocity.BuycraftPlugin;
import net.kyori.text.TextComponent;
import net.kyori.text.format.TextColor;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;

import java.io.IOException;
import java.util.Arrays;
Expand All @@ -22,7 +22,7 @@ public CouponSubcommand(final BuycraftPlugin plugin) {
@Override
public void execute(CommandSource sender, String[] args) {
if (args.length == 0) {
sender.sendMessage(TextComponent.of(plugin.getI18n().get("usage_coupon_subcommands")).color(TextColor.RED));
sender.sendMessage(Component.text(plugin.getI18n().get("usage_coupon_subcommands"), NamedTextColor.RED));
return;
}

Expand All @@ -34,7 +34,7 @@ public void execute(CommandSource sender, String[] args) {
deleteCoupon(sender, args);
break;
default:
sender.sendMessage(TextComponent.of(plugin.getI18n().get("usage_coupon_subcommands")).color(TextColor.RED));
sender.sendMessage(Component.text(plugin.getI18n().get("usage_coupon_subcommands"), NamedTextColor.RED));
break;
}
}
Expand All @@ -45,33 +45,33 @@ private void createCoupon(final CommandSource sender, String[] args) {
try {
coupon = CouponUtil.parseArguments(stripped);
} catch (Exception e) {
sender.sendMessage(TextComponent.of(plugin.getI18n().get("coupon_creation_arg_parse_failure", e.getMessage())).color(TextColor.RED));
sender.sendMessage(Component.text(plugin.getI18n().get("coupon_creation_arg_parse_failure", e.getMessage()), NamedTextColor.RED));
return;
}

plugin.getPlatform().executeAsync(() -> {
try {
plugin.getApiClient().createCoupon(coupon).execute().body();
sender.sendMessage(TextComponent.of(plugin.getI18n().get("coupon_creation_success", coupon.getCode())).color(TextColor.GREEN));
sender.sendMessage(Component.text(plugin.getI18n().get("coupon_creation_success", coupon.getCode()), NamedTextColor.GREEN));
} catch (IOException e) {
sender.sendMessage(TextComponent.of(plugin.getI18n().get("generic_api_operation_error")).color(TextColor.RED));
sender.sendMessage(Component.text(plugin.getI18n().get("generic_api_operation_error"), NamedTextColor.RED));
}
});
}

private void deleteCoupon(final CommandSource sender, String[] args) {
if (args.length != 2) {
sender.sendMessage(TextComponent.of(plugin.getI18n().get("no_coupon_specified")).color(TextColor.RED));
sender.sendMessage(Component.text(plugin.getI18n().get("no_coupon_specified"), NamedTextColor.RED));
return;
}

final String code = args[1];
plugin.getPlatform().executeAsync(() -> {
try {
plugin.getApiClient().deleteCoupon(code).execute().body();
sender.sendMessage(TextComponent.of(plugin.getI18n().get("coupon_deleted")).color(TextColor.GREEN));
sender.sendMessage(Component.text(plugin.getI18n().get("coupon_deleted"), NamedTextColor.GREEN));
} catch (IOException e) {
sender.sendMessage(TextComponent.of(e.getMessage()).color(TextColor.RED));
sender.sendMessage(Component.text(e.getMessage(), NamedTextColor.RED));
}
});
}
Expand Down
Loading