mirror of
https://github.com/taoneill/war.git
synced 2024-11-14 06:17:01 +01:00
Integrated TimWolla's changes. Commented out the health-regen hook stuff.
This commit is contained in:
parent
f475aa0fc9
commit
dbf5995337
@ -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>
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user