Players no longer regain power while dead; no more waiting to respawn in order to regain power

Also added AuthDB to softdepend list, so it has first shot at Factions commands in case it needs to cancel one
This commit is contained in:
Brettflan 2012-01-28 05:59:10 -06:00
parent 7c8e25fb8f
commit ff91cdfed7
3 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,7 @@ name: Factions
version: 1.6.4_dev
main: com.massivecraft.factions.P
authors: [Olof Larsson, Brett Flannigan]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, CaptureThePoints, CombatTag]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]
commands:
factions:
description: Reference command for Factions.

View File

@ -501,6 +501,9 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
long millisPassed = now - this.lastPowerUpdateTime;
this.lastPowerUpdateTime = now;
Player thisPlayer = this.getPlayer();
if (thisPlayer != null && thisPlayer.isDead()) return; // don't let dead players regain power until they respawn
int millisPerMinute = 60*1000;
this.alterPower(millisPassed * Conf.powerPerMinute / millisPerMinute);
}

View File

@ -483,6 +483,9 @@ public class FactionsPlayerListener implements Listener
public void onPlayerRespawn(PlayerRespawnEvent event)
{
FPlayer me = FPlayers.i.get(event.getPlayer());
me.getPower(); // update power, so they won't have gained any while dead
Location home = me.getFaction().getHome();
if
(