mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-16 00:56:41 +02:00
Fixed /god.
This commit is contained in:
parent
3b9a426547
commit
1b843b3586
@ -76,6 +76,11 @@ public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
|||||||
|
|
||||||
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
||||||
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
||||||
|
|
||||||
|
if (cfg.hasGodMode(player)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (wcfg.disableLavaDamage && type == DamageCause.LAVA) {
|
if (wcfg.disableLavaDamage && type == DamageCause.LAVA) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -99,6 +104,11 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
|||||||
|
|
||||||
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
||||||
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
||||||
|
|
||||||
|
if (cfg.hasGodMode(player)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (attacker != null && attacker instanceof Player) {
|
if (attacker != null && attacker instanceof Player) {
|
||||||
if (wcfg.useRegions) {
|
if (wcfg.useRegions) {
|
||||||
@ -150,6 +160,11 @@ public void onEntityDamageByProjectile(EntityDamageByProjectileEvent event) {
|
|||||||
|
|
||||||
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
||||||
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
||||||
|
|
||||||
|
if (cfg.hasGodMode(player)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (attacker != null && attacker instanceof Player) {
|
if (attacker != null && attacker instanceof Player) {
|
||||||
if (wcfg.useRegions) {
|
if (wcfg.useRegions) {
|
||||||
@ -204,6 +219,11 @@ public void onEntityDamage(EntityDamageEvent event) {
|
|||||||
|
|
||||||
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
ConfigurationManager cfg = plugin.getGlobalConfiguration();
|
||||||
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
WorldConfiguration wcfg = cfg.get(player.getWorld());
|
||||||
|
|
||||||
|
if (cfg.hasGodMode(player)) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (wcfg.disableFallDamage && type == DamageCause.FALL) {
|
if (wcfg.disableFallDamage && type == DamageCause.FALL) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user