Skip to content
Open

Dev #627

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.nandi0813</groupId>
<artifactId>practice-parent</artifactId>
<version>7.7.0-SNAPSHOT</version>
<version>7.8.0-SNAPSHOT</version>
</parent>

<artifactId>practice-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ public static boolean isShowMatchPlayersInTab() {
return getBoolean("MATCH-SETTINGS.SHOW-PLAYERS-IN-TAB");
}

public static boolean isShowLobbyPlayersInMatch() {
return getBoolean("MATCH-SETTINGS.SHOW-LOBBY-PLAYERS-IN-MATCH");
}

public static int getInt(String loc) {
return getConfig().getInt(loc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ public void startMatch() {

for (Player online : Bukkit.getOnlinePlayers()) {
if (!this.players.contains(online)) {
if (ConfigManager.isShowLobbyPlayersInMatch())
PlayerHider.getInstance().showPlayer(player, online);
else
PlayerHider.getInstance().hidePlayer(player, online, true);
PlayerHider.getInstance().hidePlayer(player, online, true);

if (!ConfigManager.isShowMatchPlayersInTab())
PlayerHider.getInstance().hidePlayer(online, player, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import dev.nandi0813.practice.manager.profile.enums.ProfileStatus;
import dev.nandi0813.practice.util.Cuboid;
import dev.nandi0813.practice.util.interfaces.Spectatable;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down Expand Up @@ -131,10 +132,18 @@ public void onPlayerTeleport(PlayerTeleportEvent e) {
Player player = e.getPlayer();
ensureSpectatorFlight(player);

// Some teleports or server versions can drop flight state right after teleport.
// The client ignores ability packets sent during a teleport until it has
// acknowledged the new position, so the flight state has to be re-sent after it.
ZonePractice plugin = ZonePractice.getInstance();
if (plugin != null && plugin.isEnabled()) {
org.bukkit.Bukkit.getScheduler().runTask(plugin, () -> ensureSpectatorFlight(player));
Bukkit.getScheduler().runTask(plugin, () -> ensureSpectatorFlight(player));
Bukkit.getScheduler().runTaskLater(plugin, () -> {
// Skip if the player is no longer a spectator by the time this runs.
if (player.isOnline() && hasSpectatorRestrictions(player)) {
player.setAllowFlight(false);
ensureSpectatorFlight(player);
}
}, 2L);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ public void playerJoin(PlayerJoinEvent e) {
* Hide the player from the online.
*/
if (onlineStatus.equals(ProfileStatus.MATCH) || onlineStatus.equals(ProfileStatus.EVENT) || onlineStatus.equals(ProfileStatus.FFA)) {
if (ConfigManager.isShowLobbyPlayersInMatch())
showPlayer(online, player);
else
hidePlayer(online, player, ConfigManager.isShowMatchPlayersInTab());
hidePlayer(online, player, ConfigManager.isShowMatchPlayersInTab());
} else if (!onlineStatus.equals(ProfileStatus.SPECTATE) && onlineProfile.isHidePlayers()) {
hidePlayer(online, player, false);
} else if (profile.isHideFromPlayers() && !online.hasPermission("zpp.staffmode.see")) {
Expand Down Expand Up @@ -108,10 +105,7 @@ public void playerTeleport(PlayerTeleportEvent e) {
}

// Handle the online player
if (onlineProfile.getStatus().equals(ProfileStatus.MATCH) || onlineProfile.getStatus().equals(ProfileStatus.EVENT) || onlineProfile.getStatus().equals(ProfileStatus.FFA)) {
if (ConfigManager.isShowLobbyPlayersInMatch())
showPlayer(online, player);
} else {
if (!(onlineProfile.getStatus().equals(ProfileStatus.MATCH) || onlineProfile.getStatus().equals(ProfileStatus.EVENT) || onlineProfile.getStatus().equals(ProfileStatus.FFA))) {
if (onlineProfile.isHidePlayers() && ServerManager.getInstance().getInWorld().get(online) == WorldEnum.LOBBY) {
hidePlayer(online, player, false);
} else if (!profile.isHideFromPlayers() || online.hasPermission("zpp.staffmode.see")) {
Expand Down
1 change: 0 additions & 1 deletion core/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ AUTO-SAVE:
# Match settings
MATCH-SETTINGS:
SHOW-PLAYERS-IN-TAB: false # If true, players currently in a match/FFA/event remain visible in the tab list for lobby players (otherwise they are hidden).
SHOW-LOBBY-PLAYERS-IN-MATCH: false # If true, players in a match/FFA/event can see the players in the lobby (otherwise lobby players are hidden from them).
TEAMS:
TEAM1:
NAME: "<blue>[B]"
Expand Down
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>dev.nandi0813</groupId>
<artifactId>practice-parent</artifactId>
<version>7.7.0-SNAPSHOT</version>
<version>7.8.0-SNAPSHOT</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>dev.nandi0813</groupId>
<artifactId>practice-parent</artifactId>
<version>7.7.0-SNAPSHOT</version>
<version>7.8.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>ZonePractice Pro</name>
Expand Down
Loading