mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +01:00
Flames won't appear if you are /god'ed now.
This commit is contained in:
parent
e843ff372e
commit
f5c6a9f507
@ -73,6 +73,7 @@ public void registerEvents() {
|
|||||||
PluginManager pm = plugin.getServer().getPluginManager();
|
PluginManager pm = plugin.getServer().getPluginManager();
|
||||||
|
|
||||||
registerEvent("ENTITY_DAMAGE", Priority.High);
|
registerEvent("ENTITY_DAMAGE", Priority.High);
|
||||||
|
registerEvent("ENTITY_COMBUST", Priority.High);
|
||||||
registerEvent("ENTITY_EXPLODE", Priority.High);
|
registerEvent("ENTITY_EXPLODE", Priority.High);
|
||||||
registerEvent("CREATURE_SPAWN", Priority.High);
|
registerEvent("CREATURE_SPAWN", Priority.High);
|
||||||
registerEvent("ENTITY_INTERACT", 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.
|
* Called on entity explode.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user