mirror of
https://github.com/taoneill/war.git
synced 2024-11-27 04:35:35 +01:00
Closes gh-344. Updated pom for Bukkit 1.1-R1. Fixed compatibility with Heroes and other plugins by introducing new config REALDEATHS. If you turn it on, there no longer fast respawns (i.e. the player actually dies, letting other plugins register the death). Now you can also turn off death messages with DEATHMESSAGES. Fixed bug in inventory checking job.
This commit is contained in:
parent
d027a53e02
commit
445aae7f8f
@ -56,13 +56,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.1-R1-SNAPSHOT</version>
|
<version>1.1-R1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>craftbukkit</artifactId>
|
<artifactId>craftbukkit</artifactId>
|
||||||
<version>1.1-R1-SNAPSHOT</version>
|
<version>1.1-R1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -276,6 +276,9 @@ public class Warzone {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.flagThieves.clear();
|
this.flagThieves.clear();
|
||||||
|
this.bombThieves.clear();
|
||||||
|
this.cakeThieves.clear();
|
||||||
|
this.reallyDeadFighters.clear();
|
||||||
|
|
||||||
// nom drops
|
// nom drops
|
||||||
for(Entity entity : (this.getWorld().getEntities())) {
|
for(Entity entity : (this.getWorld().getEntities())) {
|
||||||
@ -804,6 +807,7 @@ public class Warzone {
|
|||||||
playerWarzone.respawnPlayer(playerTeam, player);
|
playerWarzone.respawnPlayer(playerTeam, player);
|
||||||
} else {
|
} else {
|
||||||
// onPlayerRespawn takes care of real deaths
|
// onPlayerRespawn takes care of real deaths
|
||||||
|
//player.setHealth(0);
|
||||||
playerWarzone.getReallyDeadFighters().add(player.getName());
|
playerWarzone.getReallyDeadFighters().add(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -825,6 +829,7 @@ public class Warzone {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t.teamcast("The battle is over. Team " + playerTeam.getName() + " lost: " + player.getName() + " died and there were no lives left in their life pool.");
|
t.teamcast("The battle is over. Team " + playerTeam.getName() + " lost: " + player.getName() + " died and there were no lives left in their life pool.");
|
||||||
|
|
||||||
if (t.getPlayers().size() != 0 && !t.getTeamConfig().resolveBoolean(TeamConfig.FLAGPOINTSONLY)) {
|
if (t.getPlayers().size() != 0 && !t.getTeamConfig().resolveBoolean(TeamConfig.FLAGPOINTSONLY)) {
|
||||||
|
@ -125,7 +125,9 @@ public class WarEntityListener implements Listener {
|
|||||||
if (event.getDamage() >= d.getHealth()) {
|
if (event.getDamage() >= d.getHealth()) {
|
||||||
if (defenderWarzone.getReallyDeadFighters().contains(d.getName())) {
|
if (defenderWarzone.getReallyDeadFighters().contains(d.getName())) {
|
||||||
// don't re-kill a dead person
|
// don't re-kill a dead person
|
||||||
event.setCancelled(true);
|
if (d.getHealth() != 0) {
|
||||||
|
d.setHealth(0);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +255,9 @@ public class WarEntityListener implements Listener {
|
|||||||
if (d != null && defenderWarzone != null && event.getDamage() >= d.getHealth()) {
|
if (d != null && defenderWarzone != null && event.getDamage() >= d.getHealth()) {
|
||||||
if (defenderWarzone.getReallyDeadFighters().contains(d.getName())) {
|
if (defenderWarzone.getReallyDeadFighters().contains(d.getName())) {
|
||||||
// don't re-kill a dead person
|
// don't re-kill a dead person
|
||||||
event.setCancelled(true);
|
if (d.getHealth() != 0) {
|
||||||
|
d.setHealth(0);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,8 +431,11 @@ public class WarEntityListener implements Listener {
|
|||||||
|
|
||||||
if (zone != null && event.getDamage() >= player.getHealth()) {
|
if (zone != null && event.getDamage() >= player.getHealth()) {
|
||||||
if (zone.getReallyDeadFighters().contains(player.getName())) {
|
if (zone.getReallyDeadFighters().contains(player.getName())) {
|
||||||
// don't re-kill a dead person
|
// don't re-count the death points of an already dead person, make sure they are dead though
|
||||||
event.setCancelled(true);
|
// (reason for this is that onEntityDamage sometimes fires more than once for one death)
|
||||||
|
if (player.getHealth() != 0) {
|
||||||
|
player.setHealth(0);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,11 +568,11 @@ public class WarEntityListener implements Listener {
|
|||||||
if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.REALDEATHS)) {
|
if (!zone.getWarzoneConfig().getBoolean(WarzoneConfig.REALDEATHS)) {
|
||||||
// catch the odd death that gets away from us when usually intercepting and preventing deaths
|
// catch the odd death that gets away from us when usually intercepting and preventing deaths
|
||||||
zone.handleDeath(player);
|
zone.handleDeath(player);
|
||||||
}
|
|
||||||
|
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DEATHMESSAGES)) {
|
||||||
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DEATHMESSAGES)) {
|
for (Team team : zone.getTeams()) {
|
||||||
for (Team team : zone.getTeams()) {
|
team.teamcast(player.getName() + " died");
|
||||||
team.teamcast(player.getName() + " died");
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,12 @@ public class HelmetProtectionTask implements Runnable {
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
playerInv.setItem(playerInv.firstEmpty(), this.createBlockHead(team));
|
|
||||||
|
int firstEmpty = playerInv.firstEmpty();
|
||||||
|
if (firstEmpty > 0) {
|
||||||
|
playerInv.setItem(firstEmpty, this.createBlockHead(team));
|
||||||
|
}
|
||||||
|
|
||||||
if (removed > 1) {
|
if (removed > 1) {
|
||||||
War.war.badMsg(player, "All that " + team.getName() + " wool must have been heavy!");
|
War.war.badMsg(player, "All that " + team.getName() + " wool must have been heavy!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user