mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-06-25 22:14:50 +02:00
Add option for resetting fall distance when void falling teleport is on.
reset-fall-on-void-teleport, defaults to false. (I can't remember if old WG 6 behavior was to do this or not...?)
This commit is contained in:
parent
4044e2b122
commit
afe042ef4d
|
@ -173,6 +173,11 @@ public void sendTitle(String title, String subtitle) {
|
|||
getPlayer().sendTitle(title, subtitle, -1, -1, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetFallDistance() {
|
||||
getPlayer().setFallDistance(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getGroups() {
|
||||
return plugin.getGroups(getPlayer());
|
||||
|
|
|
@ -216,6 +216,7 @@ public void loadConfiguration() {
|
|||
teleportOnSuffocation = getBoolean("player-damage.teleport-on-suffocation", false);
|
||||
disableVoidDamage = getBoolean("player-damage.disable-void-damage", false);
|
||||
teleportOnVoid = getBoolean("player-damage.teleport-on-void-falling", false);
|
||||
safeFallOnVoid = getBoolean("player-damage.reset-fall-on-void-teleport", false);
|
||||
disableExplosionDamage = getBoolean("player-damage.disable-explosion-damage", false);
|
||||
disableMobDamage = getBoolean("player-damage.disable-mob-damage", false);
|
||||
disableDeathMessages = getBoolean("player-damage.disable-death-messages", false);
|
||||
|
|
|
@ -164,6 +164,9 @@ private void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
|||
|
||||
if (wcfg.teleportOnVoid && type == DamageCause.VOID) {
|
||||
localPlayer.findFreePosition();
|
||||
if (wcfg.safeFallOnVoid) {
|
||||
localPlayer.resetFallDistance();
|
||||
}
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -207,4 +207,9 @@ default Association getAssociation(List<ProtectedRegion> regions) {
|
|||
*/
|
||||
@Beta
|
||||
void sendTitle(String title, String subtitle);
|
||||
|
||||
/**
|
||||
* Clears fall distance.
|
||||
*/
|
||||
void resetFallDistance();
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ public abstract class WorldConfiguration {
|
|||
public boolean teleportOnSuffocation;
|
||||
public boolean disableVoidDamage;
|
||||
public boolean teleportOnVoid;
|
||||
public boolean safeFallOnVoid;
|
||||
public boolean disableExplosionDamage;
|
||||
public boolean disableMobDamage;
|
||||
public boolean highFreqFlags;
|
||||
|
|
|
@ -178,6 +178,11 @@ public void sendTitle(String title, String subtitle) {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resetFallDistance() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printRaw(String msg) {
|
||||
System.out.println("-> TestPlayer{" + this.name + "}: " + msg);
|
||||
|
|
Loading…
Reference in New Issue
Block a user