Fixed double death message bug.
This commit is contained in:
parent
abe745c0ac
commit
15e872803f
Binary file not shown.
@ -804,6 +804,7 @@ public class CustomDamage {
|
||||
damage = preventPoisonDamageFromKilling(p, damage, reason);
|
||||
|
||||
if (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER) {
|
||||
TwosideKeeper.log("Is a Slayer.", 2);
|
||||
//PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (damage>2) {
|
||||
damage=2;
|
||||
@ -827,8 +828,8 @@ public class CustomDamage {
|
||||
damage=0;
|
||||
}
|
||||
|
||||
if (p.getHealth()-damage<0) {
|
||||
p.damage(damage);
|
||||
/*(if (p.getHealth()-damage<0) {
|
||||
p.damage(p.getHealth());
|
||||
final double DMG = damage;
|
||||
Bukkit.getScheduler().runTaskLater(TwosideKeeper.plugin, ()->{
|
||||
if (p!=null && !p.isDead()) {
|
||||
@ -837,7 +838,7 @@ public class CustomDamage {
|
||||
TwosideKeeper.log("WARNING!! Player "+p.getName()+" was supposed to die! ["+TwosideKeeper.getServerTickTime()+"] Damage Taken: "+DMG+" from "+damagesource+",Reason: "+reasoning, 1);
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
}*/
|
||||
|
||||
//pd.customtitle.updateTitle(p);
|
||||
pd.customtitle.updateCombatBar(p, getDamagerEntity(damager));
|
||||
|
@ -3707,6 +3707,7 @@ public class GenericFunctions {
|
||||
boolean revived=false;
|
||||
boolean fromRoom=false;
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
DebugUtils.showStackTrace();
|
||||
if (p.getHealth()<=dmg || (PlayerMode.getPlayerMode(p)==PlayerMode.SLAYER && pd.slayermodehp<=dmg)) {
|
||||
//This means we would die from this attack. Attempt to revive the player.
|
||||
//Check all artifact armor for a perk.
|
||||
@ -3801,7 +3802,6 @@ public class GenericFunctions {
|
||||
if (!fromRoom) {
|
||||
RandomlyBreakBaubles(p);
|
||||
}
|
||||
runServerHeartbeat.UpdatePlayerScoreboardAndHealth(p);
|
||||
}
|
||||
return revived;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ public enum PlayerMode {
|
||||
}
|
||||
|
||||
public static PlayerMode getPlayerMode(Player p) {
|
||||
if (p!=null && p.isValid() && p.isOnline()) {
|
||||
if (p!=null && p.isValid() && p.isOnline() && !p.isDead()) {
|
||||
PlayerStructure pd = PlayerStructure.GetPlayerStructure(p);
|
||||
if (needsUpdating(pd)) {
|
||||
if (Check_isSlayer(p)) {
|
||||
|
@ -481,7 +481,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
public static final int REJUVENATE_COOLDOWN=6000;
|
||||
public static final int ASSASSINATE_COOLDOWN=200;
|
||||
public static final int LIFESAVER_COOLDOWN=6000;
|
||||
public static final int ARROWBARRAGE_COOLDOWN=200;
|
||||
public static final int ARROWBARRAGE_COOLDOWN=2400;
|
||||
public static final int SIPHON_COOLDOWN = 900;
|
||||
public static final int MOCK_COOLDOWN = 400;
|
||||
public static final int ICEWAND_COOLDOWN = 1200;
|
||||
@ -7854,6 +7854,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
Player p = (Player)ev.getEntity();
|
||||
};*/
|
||||
CustomDamage.setupTrueDamage(ev);
|
||||
if (dmgdealt>0) {
|
||||
ev.setDamage(DamageModifier.BASE, dmgdealt);
|
||||
log("Damage from this event is "+dmgdealt,4);
|
||||
|
||||
@ -7874,6 +7875,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ev.setCancelled(true);
|
||||
}
|
||||
if (ev.getEntity() instanceof Player) {
|
||||
Player p = (Player)ev.getEntity();
|
||||
runServerHeartbeat.UpdatePlayerScoreboardAndHealth(p);
|
||||
@ -11666,6 +11670,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
|
||||
public static void setPlayerMaxHealth(Player p, Double ratio, boolean force) {
|
||||
//Determine player max HP based on armor being worn.
|
||||
if (!p.isDead() && p.getHealth()>0) {
|
||||
if (EquipmentUpdated(p) || force) {
|
||||
TwosideKeeper.log("Equipment updated. Checking health...", 5);
|
||||
double hp=10; //Get the base max health.
|
||||
@ -11892,6 +11897,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
||||
runServerHeartbeat.UpdatePlayerScoreboardAndHealth(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user