Skip to content

Commit

Permalink
add config to negate fall damage on teleports
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanX committed Apr 12, 2024
1 parent 340b026 commit 2a29374
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -20,6 +20,9 @@ public class PermissionsConfig {

public static class Teleports {

@Config("Should fall damage be removed when teleporting? [default: false]")
public static boolean noFallDamage = false;

@Config("Should players be able to teleport to spawn? [default: true]")
public static boolean spawn = true;

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/de/melanx/skyblockbuilder/util/WorldUtil.java
Expand Up @@ -44,6 +44,9 @@ public static void teleportToIsland(ServerPlayer player, Team team) {
TemplatesConfig.Spawn spawn = validPosition(level, team);
player.teleportTo(level, spawn.pos().getX() + 0.5, spawn.pos().getY() + 0.2, spawn.pos().getZ() + 0.5, spawn.direction().getYRot(), 0);
player.setRespawnPosition(level.dimension(), spawn.pos(), spawn.direction().getYRot(), true, false);
if (PermissionsConfig.Teleports.noFallDamage) {
player.fallDistance = 0;
}
}

public static boolean isSkyblock(Level level) {
Expand Down

0 comments on commit 2a29374

Please sign in to comment.