mirror of
https://github.com/SunNetservers/MiniGames.git
synced 2025-07-14 12:04:44 +02:00
Re-implements the collision removal to fix a severe bug
This commit is contained in:
@ -91,6 +91,9 @@ public class JoinDropperArenaCommand implements CommandExecutor {
|
||||
ArenaPlayerRegistry<DropperArena> playerRegistry = MiniGames.getInstance().getDropperArenaPlayerRegistry();
|
||||
playerRegistry.registerPlayer(player.getUniqueId(), newSession);
|
||||
|
||||
// Update visibility and hit-box for the player
|
||||
MiniGames.getInstance().getPlayerVisibilityManager().updateHiddenPlayers(playerRegistry, player);
|
||||
|
||||
// Try to teleport the player to the arena
|
||||
boolean teleported = PlayerTeleporter.teleportPlayer(player, specifiedArena.getSpawnLocation(), false, false);
|
||||
if (!teleported) {
|
||||
@ -98,10 +101,9 @@ public class JoinDropperArenaCommand implements CommandExecutor {
|
||||
newSession.triggerQuit(false, true);
|
||||
return false;
|
||||
} else {
|
||||
// Make sure to update the state again in the air to remove a potential swimming state
|
||||
// Update the player's state to follow the arena's rules
|
||||
newSession.getEntryState().setArenaState();
|
||||
// Update visibility for the player
|
||||
MiniGames.getInstance().getPlayerVisibilityManager().updateHiddenPlayers(playerRegistry, player);
|
||||
|
||||
player.getInventory().addItem(GUIHelper.getGUIOpenItem());
|
||||
player.sendMessage(Message.SUCCESS_ARENA_JOINED.getMessage());
|
||||
return true;
|
||||
|
@ -89,6 +89,9 @@ public class JoinParkourArenaCommand implements CommandExecutor {
|
||||
ArenaPlayerRegistry<ParkourArena> playerRegistry = MiniGames.getInstance().getParkourArenaPlayerRegistry();
|
||||
playerRegistry.registerPlayer(player.getUniqueId(), newSession);
|
||||
|
||||
// Update visibility and hit-box for the player
|
||||
MiniGames.getInstance().getPlayerVisibilityManager().updateHiddenPlayers(playerRegistry, player);
|
||||
|
||||
// Try to teleport the player to the arena
|
||||
boolean teleported = PlayerTeleporter.teleportPlayer(player, specifiedArena.getSpawnLocation(), false, false);
|
||||
if (!teleported) {
|
||||
@ -96,10 +99,9 @@ public class JoinParkourArenaCommand implements CommandExecutor {
|
||||
newSession.triggerQuit(false, true);
|
||||
return false;
|
||||
} else {
|
||||
// Make sure to update the state again in the air to remove a potential swimming state
|
||||
// Update the player's state to follow the arena's rules
|
||||
newSession.getEntryState().setArenaState();
|
||||
// Update visibility for the player
|
||||
MiniGames.getInstance().getPlayerVisibilityManager().updateHiddenPlayers(playerRegistry, player);
|
||||
|
||||
player.getInventory().addItem(GUIHelper.getGUIOpenItem());
|
||||
player.sendMessage(Message.SUCCESS_ARENA_JOINED.getMessage());
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user