fixed ArithmeticException / 0 in ClansEnergyTracker.
This commit is contained in:
parent
0a667afeb1
commit
6372dfd629
@ -105,6 +105,11 @@ public class ClanEnergyTracker extends MiniPlugin
|
||||
|
||||
private boolean displayFor(ClanInfo clan, UpdateType type)
|
||||
{
|
||||
if (clan.getEnergyCostPerMinute() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
long energyRemainingSeconds = (clan.getEnergy() / clan.getEnergyCostPerMinute()) * 60000L;
|
||||
|
||||
switch (type)
|
||||
|
@ -62,6 +62,7 @@ public class KingHill extends WorldEvent
|
||||
_scoreMap = new HashMap<ClanInfo, CaptureData>();
|
||||
_hill = LOADED_HILLS.get(0);
|
||||
_nextLootDrop = System.currentTimeMillis() + getRandomRange(300000, 600000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -86,11 +87,8 @@ public class KingHill extends WorldEvent
|
||||
@Override
|
||||
protected void customTick()
|
||||
{
|
||||
// uh who wrote this code? below code == [divide ticksRunning by 1, if
|
||||
// remainder is 0 do tickHill()]
|
||||
// if (getTicksRunning() % 1 == 0)
|
||||
|
||||
tickHill();
|
||||
|
||||
if (System.currentTimeMillis() > _nextLootDrop)
|
||||
{
|
||||
// Drop Loot!
|
||||
|
Loading…
Reference in New Issue
Block a user