Integrated TimWolla's changes. Commented out the health-regen hook stuff.

This commit is contained in:
taoneill 2011-05-22 22:49:36 -04:00
parent f475aa0fc9
commit dbf5995337
3 changed files with 17 additions and 23 deletions

View File

@ -45,11 +45,5 @@
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nijikokun.bukkit</groupId>
<artifactId>Permissions</artifactId>
<version>2.7.4</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -156,7 +156,7 @@ public class War extends JavaPlugin {
pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.ENTITY_COMBUST, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.ENTITY_REGAIN_HEALTH, entityListener, Priority.Normal, this);
//pm.registerEvent(Event.Type.ENTITY_REGAIN_HEALTH, entityListener, Priority.Normal, this);
pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Normal, this);
pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Normal, this);

View File

@ -15,7 +15,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityListener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
//import org.bukkit.event.entity.EntityRegainHealthEvent;
import com.tommytony.war.Team;
import com.tommytony.war.Warzone;
@ -207,19 +207,19 @@ public class WarEntityListener extends EntityListener {
}
}
public void onEntityRegainHealth(EntityRegainHealthEvent event) {
if(war.isLoaded()) {
Entity entity = event.getEntity();
if(entity instanceof Player) {
Player player = (Player) entity;
Location location = player.getLocation();
Warzone zone = war.warzone(location);
if(zone != null) {
if (((CraftPlayer) player).getHandle().ticksLived % 20 * 12 == 0) {
event.setCancelled(true);
}
}
}
}
}
// public void onEntityRegainHealth(EntityRegainHealthEvent event) {
// if(war.isLoaded()) {
// Entity entity = event.getEntity();
// if(entity instanceof Player) {
// Player player = (Player) entity;
// Location location = player.getLocation();
// Warzone zone = war.warzone(location);
// if(zone != null) {
// if (((CraftPlayer) player).getHandle().ticksLived % 20 * 12 == 0) {
// event.setCancelled(true);
// }
// }
// }
// }
// }
}