mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-12 20:22:01 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0827d083bf | ||
|
|
2f7b42ab85 | ||
|
|
735aa666d6 | ||
|
|
c2ceb643e5 | ||
|
|
5c166f647f | ||
|
|
03a8fb9aa2 |
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
group = "me.neznamy"
|
||||
version = "4.1.8"
|
||||
version = "4.1.9"
|
||||
description = "An all-in-one solution that works"
|
||||
|
||||
ext.set("id", "tab")
|
||||
|
||||
@@ -2,7 +2,7 @@ dependencies {
|
||||
implementation(projects.shared)
|
||||
implementation("org.bstats:bstats-bukkit:3.0.1")
|
||||
compileOnly("org.purpurmc.purpur:purpur-api:1.16.5-R0.1-SNAPSHOT")
|
||||
compileOnly("me.clip:placeholderapi:2.11.2")
|
||||
compileOnly("me.clip:placeholderapi:2.11.6")
|
||||
compileOnly("com.mojang:authlib:1.5.25")
|
||||
compileOnly("com.github.MilkBowl:VaultAPI:1.7") {
|
||||
exclude("org.bukkit", "bukkit")
|
||||
|
||||
+4
-2
@@ -16,6 +16,7 @@ import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -309,7 +310,8 @@ public class TeamPacketData {
|
||||
if (!TeamPacketClass.isInstance(packet)) return;
|
||||
int action = TeamPacket_ACTION.getInt(packet);
|
||||
if (action == TeamAction.UPDATE) return;
|
||||
TeamPacket_PLAYERS.set(packet, player.getScoreboard().onTeamPacket(
|
||||
action, (String) TeamPacket_NAME.get(packet), (Collection<String>) TeamPacket_PLAYERS.get(packet)));
|
||||
Collection<String> players = (Collection<String>) TeamPacket_PLAYERS.get(packet);
|
||||
if (players == null) players = Collections.emptyList();
|
||||
TeamPacket_PLAYERS.set(packet, player.getScoreboard().onTeamPacket(action, (String) TeamPacket_NAME.get(packet), players));
|
||||
}
|
||||
}
|
||||
+12
-1
@@ -18,12 +18,19 @@ import me.neznamy.tab.shared.platform.EventListener;
|
||||
import me.neznamy.tab.shared.platform.TabPlayer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* The core for Velocity forwarding events into all enabled features
|
||||
*/
|
||||
@SuppressWarnings("UnstableApiUsage")
|
||||
public class VelocityEventListener implements EventListener<Player> {
|
||||
|
||||
/** Map for tracking online players */
|
||||
private final Map<Player, UUID> players = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Listens to player disconnecting from the server.
|
||||
*
|
||||
@@ -32,7 +39,10 @@ public class VelocityEventListener implements EventListener<Player> {
|
||||
*/
|
||||
@Subscribe
|
||||
public void onQuit(@NotNull DisconnectEvent e) {
|
||||
quit(e.getPlayer().getUniqueId());
|
||||
// Check if the player was actually connected to the server in the first place to avoid processing
|
||||
// disconnect of an existing player who is still there (because players are mapped by UUID in TAB)
|
||||
UUID id = players.remove(e.getPlayer());
|
||||
if (id != null) quit(id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,6 +76,7 @@ public class VelocityEventListener implements EventListener<Player> {
|
||||
tab.getCPUManager().runTask(() -> {
|
||||
TabPlayer player = tab.getPlayer(e.getPlayer().getUniqueId());
|
||||
if (player == null) {
|
||||
players.put(e.getPlayer(), e.getPlayer().getUniqueId());
|
||||
tab.getFeatureManager().onJoin(createPlayer(e.getPlayer()));
|
||||
} else {
|
||||
player.getScoreboard().freeze(); // Prevent server switch listeners from sending packets before re-registering objectives in onLoginPacket
|
||||
|
||||
Reference in new issue
Block a user