From 2fde27e0df4571c1ec4c914f52d699ebfc76ebcc Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 29 Apr 2023 12:33:24 +0200 Subject: [PATCH 1/3] Puts on a band-aid to fix Crates+Keys to give all Items on Amount -1 The KitAmount is still broken with this and I just don't understand what the algorithm and expected behaviour is supposed to be... I don't have much time for this stuff right now - The plugin needs a recode/heavy refractor --- .../com/songoda/ultimatekits/kit/Kit.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/ultimatekits/kit/Kit.java b/src/main/java/com/songoda/ultimatekits/kit/Kit.java index e39e408..cd80103 100644 --- a/src/main/java/com/songoda/ultimatekits/kit/Kit.java +++ b/src/main/java/com/songoda/ultimatekits/kit/Kit.java @@ -283,11 +283,27 @@ public class Kit implements Cloneable { } private boolean giveKit(Player player, Key key) { - return key == null ? giveKit(player) : giveKit(player, key.getAmount(), key.getKitAmount()); + if (key == null) { + return giveKit(player); + } + + int amount = key.getAmount(); + if (amount == -1) { + // FIXME: I don't understand how Crates, Keys, etc. actually are supposed to work. + // I think the give-algorithms are generally wrongly implemented and confusing naming is making it hard to understand. + amount = contents.size(); + } + return giveKit(player, amount, key.getKitAmount()); } private boolean giveKit(Player player, Crate crate) { - return giveKit(player, crate.getAmount(), crate.getKitAmount()); + int amount = crate.getAmount(); + if (amount == -1) { + // FIXME: I don't understand how Crates, Keys, etc. actually are supposed to work. + // I think the give-algorithms are generally wrongly implemented and confusing naming is making it hard to understand. + amount = contents.size(); + } + return giveKit(player, amount, crate.getKitAmount()); } private boolean giveKit(Player player, int itemAmount, int kitAmount) { From bddef66d17e010ff755d5916388ef771052f5bc0 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 29 Apr 2023 12:54:07 +0200 Subject: [PATCH 2/3] Updates SongodaCore to v2.6.21 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f2927a3..49208fe 100644 --- a/pom.xml +++ b/pom.xml @@ -118,7 +118,7 @@ com.songoda SongodaCore - 2.6.19 + 2.6.21 compile From 193cf85810c7f033e803493f0aad7311958ccab0 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sat, 29 Apr 2023 12:54:13 +0200 Subject: [PATCH 3/3] Release v2.7.7 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 49208fe..2edf8e4 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.songoda UltimateKits - 2.7.6 + 2.7.7 UltimateKits Creating and displaying your servers kits has never been easier