Skip to content

Commit

Permalink
Merge pull request #181 from TownyAdvanced/feature/small-tweaks
Browse files Browse the repository at this point in the history
Small changes
  • Loading branch information
Goosius1 authored Mar 5, 2021
2 parents e203303 + 19b4dcb commit 0386e74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void showSiegeWarHelp(CommandSender sender) {
sender.sendMessage(ChatTools.formatCommand("Eg", "/sw collect", "", Translation.of("nation_help_11")));
sender.sendMessage(ChatTools.formatCommand("Eg", "/sw nation", "paysoldiers [amount]", Translation.of("nation_help_12")));
sender.sendMessage(ChatTools.formatCommand("Eg", "/sw preference", "beacons [on/off]", ""));
sender.sendMessage(ChatTools.formatCommand("Eg", "/sw version", ""));
sender.sendMessage(ChatTools.formatCommand("Eg", "/sw version", "", ""));
}

private void showNationHelp(CommandSender sender) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ public static void evaluateSiegePlayerDeath(Player deadPlayer, PlayerDeathEvent
private static void degradeInventory(PlayerDeathEvent playerDeathEvent) {
Damageable damageable;
double maxDurability;
int currentDurability;
int damageToInflict;
int newDurability;
int currentDurability, damageToInflict, newDurability, durabilityWarning;
Boolean closeToBreaking = false;
if (SiegeWarSettings.getWarSiegeDeathPenaltyDegradeInventoryEnabled()) {
for (ItemStack itemStack : playerDeathEvent.getEntity().getInventory().getContents()) {
Expand All @@ -194,11 +192,14 @@ private static void degradeInventory(PlayerDeathEvent playerDeathEvent) {
damageToInflict = (int)(maxDurability / 100 * SiegeWarSettings.getWarSiegeDeathPenaltyDegradeInventoryPercentage());
newDurability = currentDurability + damageToInflict;
if (newDurability >= maxDurability) {
damageable.setDamage(Math.max((int)maxDurability-10, currentDurability));
damageable.setDamage(Math.max((int)maxDurability-25, currentDurability));
closeToBreaking = true;
}
else {
damageable.setDamage(newDurability);
durabilityWarning = damageToInflict * 2 + currentDurability;
if (durabilityWarning >= maxDurability)
closeToBreaking = true;
}
itemStack.setItemMeta((ItemMeta)damageable);
}
Expand Down

0 comments on commit 0386e74

Please sign in to comment.