From 5a7024db4c6c1906c11fa0c1a1f1e6ec93340bbc Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Sun, 15 Sep 2013 01:08:20 +0200 Subject: [PATCH] Fix deprecated warnings related to int vs double damage. --- src/com/massivecraft/factions/entity/UConf.java | 4 ++-- .../massivecraft/factions/listeners/FactionsListenerMain.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/massivecraft/factions/entity/UConf.java b/src/com/massivecraft/factions/entity/UConf.java index 16adf5e1..de9dfa07 100644 --- a/src/com/massivecraft/factions/entity/UConf.java +++ b/src/com/massivecraft/factions/entity/UConf.java @@ -135,10 +135,10 @@ public class UConf extends Entity // -------------------------------------------- // public boolean permanentFactionsDisableLeaderPromotion = false; - public int actionDeniedPainAmount = 2; + public double actionDeniedPainAmount = 2.0D; public boolean disablePVPForFactionlessPlayers = false; public boolean enablePVPAgainstFactionlessInAttackersLand = false; - public double territoryShieldFactor = 0.3; + public double territoryShieldFactor = 0.3D; // -------------------------------------------- // // DENY COMMANDS diff --git a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java index 2332f804..74891833 100644 --- a/src/com/massivecraft/factions/listeners/FactionsListenerMain.java +++ b/src/com/massivecraft/factions/listeners/FactionsListenerMain.java @@ -388,7 +388,7 @@ public class FactionsListenerMain implements Listener double damage = event.getDamage(); if (damage > 0.0 && udefender.hasFaction() && ownTerritory && uconf.territoryShieldFactor > 0) { - int newDamage = (int)Math.ceil(damage * (1D - uconf.territoryShieldFactor)); + double newDamage = damage * (1D - uconf.territoryShieldFactor); event.setDamage(newDamage); // Send message