Flames won't appear if you are /god'ed now.

This commit is contained in:
sk89q 2011-06-26 19:06:07 -07:00
parent e843ff372e
commit f5c6a9f507

View File

@ -73,6 +73,7 @@ public void registerEvents() {
PluginManager pm = plugin.getServer().getPluginManager();
registerEvent("ENTITY_DAMAGE", Priority.High);
registerEvent("ENTITY_COMBUST", Priority.High);
registerEvent("ENTITY_EXPLODE", Priority.High);
registerEvent("CREATURE_SPAWN", Priority.High);
registerEvent("ENTITY_INTERACT", Priority.High);
@ -403,6 +404,29 @@ public void onEntityDamage(EntityDamageEvent event) {
}
}
/**
* Called on entity combust.
*/
@Override
public void onEntityCombust(EntityCombustEvent event) {
if (event.isCancelled()) {
return;
}
Entity entity = event.getEntity();
ConfigurationManager cfg = plugin.getGlobalStateManager();
if (entity instanceof Player) {
Player player = (Player) entity;
if (cfg.hasGodMode(player)) {
event.setCancelled(true);
return;
}
}
}
/**
* Called on entity explode.
*/