Step 1 in many removing the universe system. Untested and lacking auto convert features.

This commit is contained in:
Olof Larsson
2014-09-17 13:17:33 +02:00
parent c0b7b783b2
commit 529ae45ede
99 changed files with 1789 additions and 2662 deletions

View File

@ -1,9 +1,7 @@
package com.massivecraft.factions.task;
import com.massivecraft.factions.entity.FactionColl;
import com.massivecraft.factions.entity.FactionColls;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.massivecore.ModuloRepeatTask;
import com.massivecraft.massivecore.util.TimeUnit;
@ -35,13 +33,7 @@ public class TaskEconLandReward extends ModuloRepeatTask
@Override
public void invoke(long now)
{
for (FactionColl coll : FactionColls.get().getColls())
{
// Check disabled
if (UConf.isDisabled(coll)) continue;
coll.econLandRewardRoutine();
}
FactionColl.get().econLandRewardRoutine();
}
}

View File

@ -1,9 +1,7 @@
package com.massivecraft.factions.task;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayerColl;
import com.massivecraft.factions.entity.UPlayerColls;
import com.massivecraft.factions.entity.MPlayerColl;
import com.massivecraft.massivecore.ModuloRepeatTask;
import com.massivecraft.massivecore.util.TimeUnit;
@ -35,13 +33,7 @@ public class TaskPlayerDataRemove extends ModuloRepeatTask
@Override
public void invoke(long now)
{
for (UPlayerColl coll : UPlayerColls.get().getColls())
{
// Check disabled
if (UConf.isDisabled(coll)) continue;
coll.removePlayerDataAfterInactiveDaysRoutine();
}
MPlayerColl.get().removePlayerDataAfterInactiveDaysRoutine();
}
}

View File

@ -4,8 +4,7 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.massivecraft.factions.entity.MConf;
import com.massivecraft.factions.entity.UConf;
import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.MPlayer;
import com.massivecraft.factions.event.EventFactionsPowerChange;
import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason;
import com.massivecraft.massivecore.ModuloRepeatTask;
@ -43,20 +42,17 @@ public class TaskPlayerPowerUpdate extends ModuloRepeatTask
for (Player player : Bukkit.getOnlinePlayers())
{
// Check disabled
if (UConf.isDisabled(player)) continue;
if (player.isDead()) continue;
UPlayer uplayer = UPlayer.get(player);
double newPower = uplayer.getPower() + uplayer.getPowerPerHour() * millis / TimeUnit.MILLIS_PER_HOUR;
MPlayer mplayer = MPlayer.get(player);
double newPower = mplayer.getPower() + mplayer.getPowerPerHour() * millis / TimeUnit.MILLIS_PER_HOUR;
EventFactionsPowerChange event = new EventFactionsPowerChange(null, uplayer, PowerChangeReason.TIME, newPower);
EventFactionsPowerChange event = new EventFactionsPowerChange(null, mplayer, PowerChangeReason.TIME, newPower);
event.run();
if (event.isCancelled()) continue;
newPower = event.getNewPower();
uplayer.setPower(newPower);
mplayer.setPower(newPower);
}
}