3
0
Mirror von https://github.com/TheSilentPro/HeadDB.git synchronisiert 2024-12-25 18:40:07 +01:00
Dieser Commit ist enthalten in:
Silent 2023-12-30 00:10:47 +01:00
Ursprung 282a711dcb
Commit d279c764d9
5 geänderte Dateien mit 29 neuen und 38 gelöschten Zeilen

1
.gitignore vendored
Datei anzeigen

@ -3,7 +3,6 @@ target/
src/test/
dependency-reduced-pom.xml
build.properties
build/
.classpath

Datei anzeigen

@ -6,7 +6,7 @@
<groupId>tsp.headdb</groupId>
<artifactId>HeadDB</artifactId>
<version>5.0.0-rc.8</version>
<version>5.0.0-rc.9</version>
<packaging>jar</packaging>
<name>HeadDB</name>

Datei anzeigen

@ -15,6 +15,7 @@ public class CommandInfo extends SubCommand {
public void handle(CommandSender sender, String[] args) {
if (HeadDB.getInstance().getConfig().getBoolean("showAdvancedPluginInfo")) {
PlayerUtils.sendMessage(sender, "&7Running &6HeadDB - " + Utils.getVersion().orElse(HeadDB.getInstance().getDescription().getVersion() + " &7(&4UNKNOWN SEMVER&7)"));
//PlayerUtils.sendMessage(sender, "&7Build: " + HeadDB.getInstance().getDescription().getVersion());
PlayerUtils.sendMessage(sender, "&7GitHub: &6https://github.com/TheSilentPro/HeadDB");
} else {
PlayerUtils.sendMessage(sender, "&7Running &6HeadDB &7by &6TheSilentPro (Silent)");

Datei anzeigen

@ -213,9 +213,7 @@ public class Utils {
.replace("%cost%", HeadDB.getInstance().getDecimalFormat().format(cost))
);
try (Promise<Boolean> economyPromise = optional.get().purchase(player, cost)) {
// TODO: Might not need to be sync.
return economyPromise.thenApplySync((success) -> {
return optional.get().purchase(player, cost).thenApplyAsync(success -> {
if (success) {
HeadDB.getInstance().getLocalization().sendMessage(player, "completePayment", msg -> msg
.replace("%name%", head.getName())
@ -225,17 +223,12 @@ public class Utils {
}
return success;
});
} catch (Exception ex) {
HeadDB.getInstance().getLog().severe("Failed to process payment: " + ex.getMessage());
return Promise.exceptionally(ex);
}
}
}
public static void purchase(Player player, Head head, int amount) {
// Bukkit API - Has to be sync.
try (Promise<Boolean> paymentPromise = processPayment(player, head, amount)) {
paymentPromise.thenAcceptSync((success) -> {
processPayment(player, head, amount).thenAcceptSync(success -> {
if (success) {
ItemStack item = head.getItem(player.getUniqueId());
item.setAmount(amount);
@ -252,9 +245,6 @@ public class Utils {
});
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
public static Optional<String> getTexture(ItemStack head) {

Datei anzeigen

@ -0,0 +1 @@
version=${project.version}