Skip to content
Merged

Fixes #537

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
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,10 @@ public void onPlayerDeath(PlayerDeathEvent e) {
ffa.killPlayer(player, killer, cause.getMessage().replace("%killer%", killer != null ? killer.getName() : "Unknown"));

if (killer != null) {
Statistic statistic = ffa.getStatistics().get(killer);
Statistic statistic = ffa.getStatistics().computeIfAbsent(
killer,
p -> new Statistic(ProfileManager.getInstance().getUuids().get(p))
);
statistic.setKills(statistic.getKills() + 1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,6 @@ public void showKitChooserOrApplyKit(TeamEnum team) {
ItemStack[] inventory = kit.getInventory();
ItemStack[] armor = kit.getArmor();

// Legacy safeguard: old kits may still have armor appended into inventory[36..39].
if (inventory != null && inventory.length > 36) {
if (armor == null) {
armor = new ItemStack[]{
inventory[36],
inventory.length > 37 ? inventory[37] : null,
inventory.length > 38 ? inventory[38] : null,
inventory.length > 39 ? inventory[39] : null
};
}

ItemStack[] trimmed = new ItemStack[36];
System.arraycopy(inventory, 0, trimmed, 0, 36);
inventory = trimmed;
}

if (armor == null) {
armor = ladder.getKitData().getArmor();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,6 @@ public void update() {

// Load armor BEFORE filler logic to prevent filler items from overwriting armor slots
ItemStack[] customKitArmor = customKit.getArmor();
if (customKitArmor == null) {
// Legacy fallback for old kits where armor was appended to inventory[36..39]
ItemStack[] customKitInventory = customKit.getInventory();
if (customKitInventory != null && customKitInventory.length > 39) {
customKitArmor = new ItemStack[]{
customKitInventory[36],
customKitInventory[37],
customKitInventory[38],
customKitInventory[39]
};
}
}

if (customKitArmor == null) {
customKitArmor = ladder.getKitData().getArmor();
Expand Down
Loading