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:07 -06:00
parent 5ac0baf84a
commit 30b3facc19
3 changed files with 7 additions and 1 deletions

View File

@ -2,7 +2,7 @@ name: Factions
version: 1.7_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

@ -385,6 +385,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;
double powerPerMinute = Conf.powerPerMinute;
if(Conf.scaleNegativePower && this.power < 0)

View File

@ -285,6 +285,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
(