Drop support for auto-respawn.

This commit removes the `auto-respawn` arena setting and the logic associated with it.

MobArena's hacky implementation of auto-respawning is buggy and discouraged. To get true auto-respawn functionality we'd have to move to the Spigot API instead of the Bukkit API.
This commit is contained in:
Andreas Troelsen
2019-08-05 16:00:01 +02:00
parent bbd70d0692
commit cb8983b162
3 changed files with 2 additions and 16 deletions
+1
View File
@@ -25,6 +25,7 @@ These changes will (most likely) be included in the next version.
- Cat and parrot pets now also sit when their owner joins an arena (although parrots perching on players' shoulders will still follow them into the arena). - Cat and parrot pets now also sit when their owner joins an arena (although parrots perching on players' shoulders will still follow them into the arena).
- Pig zombies are now angry immediately after they spawn as they should be. - Pig zombies are now angry immediately after they spawn as they should be.
- Support for denoting potion effects by magic number IDs has been dropped. This means that if your config-file has any such magic numbers in it, MobArena will no longer successfully parse them and will throw an error on startup. - Support for denoting potion effects by magic number IDs has been dropped. This means that if your config-file has any such magic numbers in it, MobArena will no longer successfully parse them and will throw an error on startup.
- Support for auto-respawning has been dropped. The hacky way it was implemented is not officially supported by the Bukkit API and is highly discouraged because it is very buggy.
## [0.103.2] - 2019-04-23 ## [0.103.2] - 2019-04-23
- MobArena no longer touches the `flySpeed` player attribute when players join an arena. This should fix issues where a crash would result in players being "locked in the air" when trying to fly outside of the arena. It also introduces compatibility with plugins that use flight to augment player abilities. - MobArena no longer touches the `flySpeed` player attribute when players join an arena. This should fix issues where a crash would result in players being "locked in the air" when trying to fly outside of the arena. It also introduces compatibility with plugins that use flight to augment player abilities.
@@ -829,17 +829,7 @@ public class ArenaImpl implements Arena
clearInv(p); clearInv(p);
} }
if (!settings.getBoolean("auto-respawn", true)) { deadPlayers.add(p);
deadPlayers.add(p);
endArena();
return;
}
double full = p.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
p.setHealth(full);
plugin.getServer().getScheduler()
.scheduleSyncDelayedTask(plugin, () -> revivePlayer(p));
endArena(); endArena();
} }
@@ -863,10 +853,6 @@ public class ArenaImpl implements Arena
@Override @Override
public void playerRespawn(Player p) { public void playerRespawn(Player p) {
if (settings.getBoolean("auto-respawn", true)) {
return;
}
deadPlayers.remove(p); deadPlayers.remove(p);
plugin.getServer().getScheduler() plugin.getServer().getScheduler()
.scheduleSyncDelayedTask(plugin, () -> revivePlayer(p)); .scheduleSyncDelayedTask(plugin, () -> revivePlayer(p));
-1
View File
@@ -15,7 +15,6 @@ pvp-enabled: false
monster-infight: false monster-infight: false
allow-teleporting: false allow-teleporting: false
spectate-on-death: true spectate-on-death: true
auto-respawn: true
share-items-in-arena: true share-items-in-arena: true
min-players: 0 min-players: 0
max-players: 0 max-players: 0