mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 10:37:41 +01:00
Added config to disable damage from falling into the void.
This commit is contained in:
parent
21a04cc8c8
commit
3cb9b90ef0
@ -67,6 +67,8 @@ player-damage:
|
||||
disable-suffocation-damage: off
|
||||
disable-contact-damage: off
|
||||
teleport-on-suffocation: off
|
||||
disable-void-damage: off
|
||||
teleport-on-void-falling: off
|
||||
|
||||
regions:
|
||||
enable: on
|
||||
|
@ -86,6 +86,8 @@ public class WorldConfiguration {
|
||||
public boolean disableDrowningDamage;
|
||||
public boolean disableSuffocationDamage;
|
||||
public boolean teleportOnSuffocation;
|
||||
public boolean disableVoidDamage;
|
||||
public boolean teleportOnVoid;
|
||||
public boolean useRegions;
|
||||
public boolean highFreqFlags;
|
||||
public int regionWand = 287;
|
||||
@ -169,6 +171,9 @@ private void loadConfiguration() {
|
||||
disableSuffocationDamage = config.getBoolean("player-damage.disable-suffocation-damage", false);
|
||||
disableContactDamage = config.getBoolean("player-damage.disable-contact-damage", false);
|
||||
teleportOnSuffocation = config.getBoolean("player-damage.teleport-on-suffocation", false);
|
||||
disableVoidDamage = config.getBoolean("player-damage.disable-void-damage", false);
|
||||
//this is pretty useless since presumably there won't be much above them if they fall into a big hole
|
||||
teleportOnVoid = config.getBoolean("player-damage.teleport-on-void-falling", false);
|
||||
|
||||
useRegions = config.getBoolean("regions.enable", true);
|
||||
highFreqFlags = config.getBoolean("regions.high-frequency-flags", false);
|
||||
|
@ -93,6 +93,17 @@ public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (wcfg.teleportOnVoid && type == DamageCause.VOID) {
|
||||
findFreePosition(player);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (wcfg.disableVoidDamage && type == DamageCause.VOID) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user