Step 1 in many removing the universe system. Untested and lacking auto convert features.
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user