mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-08 03:29:46 +01:00
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
This commit is contained in:
parent
ca3f893fba
commit
2fde27e0df
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user