diff --git a/changelog.md b/changelog.md index a69e29a..3e6bd54 100644 --- a/changelog.md +++ b/changelog.md @@ -16,6 +16,7 @@ These changes will (most likely) be included in the next version. - Elytra are now supported chest pieces in class chests. - Elytra and Netherite armor pieces now correctly auto-equip if specified in the generic `armor` node in classes in the config-file. - Boss names now support color codes. +- New per-arena setting `arena-warp-offset` can be used to spread out players randomly by an offset from the arena warp. This should help prevent players taking suffocation damage. - The Root Target ability now uses potion effects (slowness, slow falling, and negative jump boost) instead of repeated teleports. This should make for a smoother root experience. - Using `spectate-on-death: true` no longer forces players out to their join location/exit warp before moving them to the spectator area. This should prevent "jumpy" behavior in multi-world setups. - Players should now properly respawn at the spectator area rather than at world spawn on servers with plugins that override respawn locations. diff --git a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java index 84ceab7..04f2fba 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java @@ -126,6 +126,9 @@ public class ArenaImpl implements Arena private StartDelayTimer startDelayTimer; private boolean isolatedChat; + // Warp offsets + private double arenaWarpOffset; + // Scoreboards private ScoreboardManager scoreboard; @@ -220,6 +223,8 @@ public class ArenaImpl implements Arena this.isolatedChat = settings.getBoolean("isolated-chat", false); + this.arenaWarpOffset = settings.getDouble("arena-warp-offset", 0.0); + // Scoreboards this.scoreboard = (settings.getBoolean("use-scoreboards", true) ? new ScoreboardManager(this) : new NullScoreboardManager(this)); @@ -518,7 +523,16 @@ public class ArenaImpl implements Arena } movingPlayers.add(p); - p.teleport(region.getArenaWarp()); + if (arenaWarpOffset > 0.01) { + Location warp = region.getArenaWarp(); + double x = warp.getX() + (arenaWarpOffset * 2 * (Math.random() - 0.5)); + double y = warp.getY(); + double z = warp.getZ() + (arenaWarpOffset * 2 * (Math.random() - 0.5)); + Location offset = new Location(warp.getWorld(), x, y, z); + p.teleport(offset); + } else { + p.teleport(region.getArenaWarp()); + } movingPlayers.remove(p); addClassPermissions(p); diff --git a/src/main/resources/res/settings.yml b/src/main/resources/res/settings.yml index 68ca6f4..3711fce 100644 --- a/src/main/resources/res/settings.yml +++ b/src/main/resources/res/settings.yml @@ -35,6 +35,7 @@ auto-start-timer: 0 start-delay-timer: 0 auto-ready: false use-class-chests: false +arena-warp-offset: 0 boss-health-bar: boss-bar display-waves-as-level: false display-timer-as-level: false