Compare commits

..
18 Commits
Author SHA1 Message Date
NEZNAMY bef190ddd7 6.0.2 2026-04-25 18:06:51 +02:00
NEZNAMY cf320b3fa2 [GitHub] Fix compilation 2026-04-25 16:47:32 +02:00
NEZNAMY 34c8745fa9 [Build] Add another shadow jar task for non-modded platforms to avoid error on Paper 1.20.5 - 1.21.4 2026-04-25 16:37:52 +02:00
NEZNAMY 8096ff7f98 Merge pull request #1646 from JT122406/master
Fabric and NeoForge for 26.1.2
2026-04-25 15:48:02 +02:00
NEZNAMY dad3006f84 Refactor TabListEntryTracker into an interface to avoid class loading error on Bukkit 1.7.10 2026-04-23 20:15:50 +02:00
NEZNAMY 0e35f15a86 [Bukkit] Change check to avoid false flag on modded servers 2026-04-23 17:29:08 +02:00
NEZNAMY d423740273 [Nametags] Prefer color codes for team color over magic codes if both are used 2026-04-22 18:11:07 +02:00
NEZNAMY 49f489c4dc [Teams] [Performance] Only send teams to players visible in the tablist, small refactor and a bug fix with disable-condition 2026-04-22 17:48:46 +02:00
NEZNAMY ac71bf2111 [Bossbar] Add more info to dump command output 2026-04-20 19:57:40 +02:00
Joseph T. McQuigg 6d40dd12fa Java 25 in fabric.mod.json 2026-04-19 15:11:46 -04:00
Joseph T. McQuigg a732abcdd6 Refresh 2026-04-19 14:42:25 -04:00
Joseph T. McQuigg c2f90f9daf Fix Credits, Fix Version Numbers 2026-04-19 14:37:29 -04:00
Joseph T. McQuigg 898f56c32a Forge for 26.1.2/1/0 (Non-Working) 2026-04-19 14:17:53 -04:00
Joseph T. McQuigg 2ebc4384f5 NeoForge for 26.1.2/1/0 2026-04-19 13:55:57 -04:00
Joseph T. McQuigg 687b8d5e29 Fabric for 26.1.2/1/0 2026-04-19 13:38:28 -04:00
NEZNAMY d09d95e069 6.0.2-SNAPSHOT 2026-04-19 17:57:05 +02:00
NEZNAMY 4dffc1ffe9 [Bukkit] Update supported version interval in error message 2026-04-16 19:01:30 +02:00
NEZNAMY f3b2cfbb87 [Description] Update badges 2026-04-13 17:02:47 +02:00
121 changed files with 1105 additions and 790 deletions

No files matched your search

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="156" height="20" role="img" aria-label="Minecraft: 1.7.x - 1.21.11"><title>Minecraft: 1.7.x - 1.21.11</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="156" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="61" height="20" fill="#555"/><rect x="61" width="95" height="20" fill="#007ec6"/><rect width="156" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="315" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="510">Minecraft</text><text x="315" y="140" transform="scale(.1)" fill="#fff" textLength="510">Minecraft</text><text aria-hidden="true" x="1075" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="850">1.7.x - 1.21.11</text><text x="1075" y="140" transform="scale(.1)" fill="#fff" textLength="850">1.7.x - 1.21.11</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="92" height="20" role="img" aria-label="Release: 6.0.0"><title>Release: 6.0.0</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="92" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="53" height="20" fill="#555"/><rect x="53" width="39" height="20" fill="#007ec6"/><rect width="92" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="275" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">Release</text><text x="275" y="140" transform="scale(.1)" fill="#fff" textLength="430">Release</text><text aria-hidden="true" x="715" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="290">6.0.0</text><text x="715" y="140" transform="scale(.1)" fill="#fff" textLength="290">6.0.0</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="92" height="20" role="img" aria-label="Release: 6.0.2"><title>Release: 6.0.2</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="92" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="53" height="20" fill="#555"/><rect x="53" width="39" height="20" fill="#007ec6"/><rect width="92" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="275" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">Release</text><text x="275" y="140" transform="scale(.1)" fill="#fff" textLength="430">Release</text><text aria-hidden="true" x="715" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="290">6.0.2</text><text x="715" y="140" transform="scale(.1)" fill="#fff" textLength="290">6.0.2</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+1 -4
View File
@@ -274,12 +274,9 @@ if __name__ == "__main__":
]
)
release = "6.0.0"
release = "6.0.2"
download_image(f"https://img.shields.io/badge/Release-{release}-blue.svg", "Badge_Release.svg")
minecraft = "1.7.x - 1.21.11".replace(" ", "%20").replace("-", "--")
download_image(f"https://img.shields.io/badge/Minecraft-{minecraft}-blue.svg", "Badge_Minecraft.svg")
java = "8+"
download_image(f"https://img.shields.io/badge/Java-{java}-blue.svg", "Badge_Java.svg")
+10 -6
View File
@@ -8,11 +8,11 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # https://github.com/actions/checkout/releases
- uses: actions/checkout@v6 # https://github.com/actions/checkout/releases
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 25
uses: actions/setup-java@v4 # https://github.com/actions/setup-java/releases
uses: actions/setup-java@v5 # https://github.com/actions/setup-java/releases
with:
distribution: 'temurin'
java-version: 25
@@ -31,11 +31,15 @@ jobs:
run: ./gradlew clean build
- name: Rename JAR with Build Number
run: |
original_jar=$(find jar/build/libs -type f -name "TAB-*.jar")
new_name=$(echo "$original_jar" | sed "s/TAB-\(.*\)\.jar/TAB-\1+${{ github.run_number }}.jar/")
mv "$original_jar" "$new_name"
find jar/build/libs -type f -name "TAB v*.jar" -print0 | while IFS= read -r -d '' original; do
dir=$(dirname "$original")
base=$(basename "$original")
new_base="${base%.jar}+${{ github.run_number }}.jar"
new_path="$dir/$new_base"
mv "$original" "$new_path"
done
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.3 # https://github.com/actions/upload-artifact/releases
with:
name: Click here to download
path: jar/build/libs/TAB-*+${{ github.run_number }}.jar
path: "jar/build/libs/TAB v*+${{ github.run_number }}.jar"
+2 -2
View File
@@ -3,7 +3,7 @@ plugins {
}
dependencies {
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.4.0")
implementation("com.gradleup.shadow:shadow-gradle-plugin:9.4.1")
implementation("io.freefair.gradle:lombok-plugin:9.2.0")
implementation("dev.architectury.loom:dev.architectury.loom.gradle.plugin:1.13-SNAPSHOT")
implementation("dev.architectury.loom-no-remap:dev.architectury.loom-no-remap.gradle.plugin:1.14-SNAPSHOT")
}
@@ -13,7 +13,8 @@ tasks {
"version" to project.version,
"description" to project.description,
"website" to rootProject.ext.get("website")!!.toString(),
"author" to rootProject.ext.get("author")!!.toString()
"author" to rootProject.ext.get("author")!!.toString(),
"credits" to rootProject.ext.get("credits")!!.toString()
))
}
javadoc {
+3 -3
View File
@@ -4,7 +4,7 @@ plugins {
allprojects {
group = "me.neznamy"
version = "6.0.1"
version = "6.0.2"
description = "An all-in-one solution that works"
ext.set("id", "tab")
@@ -60,8 +60,8 @@ val platformPaths = setOf(
":bungeecord",
":velocity",
":fabric",
":neoforge",
":forge"
":neoforge"
// ":forge"
)
val specialPaths = setOf(
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.paper_1_20_5;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.paper_1_21_11;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.paper_1_21_2;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.paper_1_21_4;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.paper_1_21_9;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -44,8 +44,7 @@ public class BukkitEventListener implements EventListener<Player>, Listener {
public void onJoin(PlayerJoinEvent e) {
TAB.getInstance().addTablistTracker(
e.getPlayer().getUniqueId(),
platform.getServerVersionInfo().getImplementationProvider().getChannel(e.getPlayer()),
platform.getServerVersionInfo().getImplementationProvider().newTabListEntryTracker()
platform.getServerVersionInfo().getImplementationProvider().newTabListEntryTracker(e.getPlayer())
);
join(e.getPlayer());
}
@@ -20,7 +20,7 @@ public class BukkitTAB extends JavaPlugin {
} catch (IllegalStateException e) {
Bukkit.getConsoleSender().sendMessage("§c[TAB] ================================================================================");
Bukkit.getConsoleSender().sendMessage("§c[TAB] Your server version (" + Bukkit.getBukkitVersion() + ") is not supported.");
Bukkit.getConsoleSender().sendMessage("§c[TAB] This jar only supports 1.7.10, 1.8.8, 1.9.4 - 1.15.x, 1.16.5, 1.17.1, 1.18.2 - 26.1.1");
Bukkit.getConsoleSender().sendMessage("§c[TAB] This jar only supports 1.7.10, 1.8.8, 1.9.4 - 1.15.x, 1.16.5, 1.17.1, 1.18.2 - 26.1.2");
Bukkit.getConsoleSender().sendMessage("§c[TAB] If you just updated to a new Minecraft version, check for TAB updates.");
Bukkit.getConsoleSender().sendMessage("§c[TAB] If you are using an unsupported 1.x version, use an older version of TAB (latest TAB 5.x supports all MC 1.x versions).");
Bukkit.getConsoleSender().sendMessage("§c[TAB] Thrown error message: " + e.getMessage());
@@ -143,7 +143,8 @@ public class BukkitPlatform implements BackendPlatform {
@Override
@Nullable
public PipelineInjector createPipelineInjector() {
return ReflectionUtils.classExists("io.netty.channel.Channel") ? new BukkitPipelineInjector() : null;
return serverVersionInfo.getServerVersion().getNetworkId() >= ProtocolVersion.V1_8.getNetworkId()
? new BukkitPipelineInjector() : null;
}
@Override
@@ -55,10 +55,12 @@ public interface ImplementationProvider {
/**
* Creates a new instance of tab list entry tracker.
*
* @param player
* Player to create tab list entry tracker for
* @return Newly created tab list entry tracker
*/
@NotNull
TabListEntryTracker newTabListEntryTracker();
TabListEntryTracker newTabListEntryTracker(@NotNull Player player);
/**
* Returns ping of the given player.
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_10_R1;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_10_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_10_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -15,13 +16,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = Arrays.stream(PacketPlayOutPlayerInfo.class.getDeclaredClasses()).filter(c -> !c.isEnum() && c.getConstructors().length > 0).findFirst().get();
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_11_R1;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_11_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_11_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,13 +15,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = PacketPlayOutPlayerInfo.class.getDeclaredClasses()[0];
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_12_R1;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_12_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,13 +15,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = PacketPlayOutPlayerInfo.class.getDeclaredClasses()[0];
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_13_R2;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_13_R2.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_13_R2.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,13 +15,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = PacketPlayOutPlayerInfo.class.getDeclaredClasses()[0];
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_14_R1;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_14_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_14_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,13 +15,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = PacketPlayOutPlayerInfo.class.getDeclaredClasses()[0];
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_15_R1;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_15_R1.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,13 +15,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = PacketPlayOutPlayerInfo.class.getDeclaredClasses()[0];
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_16_R3;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,13 +15,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = PacketPlayOutPlayerInfo.class.getDeclaredClasses()[0];
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_17_R1;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import org.jetbrains.annotations.NotNull;
@@ -8,11 +9,15 @@ import org.jetbrains.annotations.NotNull;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final EnumPlayerInfoAction ADD_PLAYER = EnumPlayerInfoAction.valueOf("ADD_PLAYER");
private static final EnumPlayerInfoAction REMOVE_PLAYER = EnumPlayerInfoAction.valueOf("REMOVE_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof PacketPlayOutPlayerInfo) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_18_R2;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import org.jetbrains.annotations.NotNull;
@@ -8,11 +9,15 @@ import org.jetbrains.annotations.NotNull;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final EnumPlayerInfoAction ADD_PLAYER = EnumPlayerInfoAction.valueOf("ADD_PLAYER");
private static final EnumPlayerInfoAction REMOVE_PLAYER = EnumPlayerInfoAction.valueOf("REMOVE_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof PacketPlayOutPlayerInfo) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_19_R1;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
import org.jetbrains.annotations.NotNull;
@@ -8,11 +9,15 @@ import org.jetbrains.annotations.NotNull;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final EnumPlayerInfoAction ADD_PLAYER = EnumPlayerInfoAction.valueOf("ADD_PLAYER");
private static final EnumPlayerInfoAction REMOVE_PLAYER = EnumPlayerInfoAction.valueOf("REMOVE_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof PacketPlayOutPlayerInfo) {
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_19_R2;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_19_R3;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_20_R1;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_20_R2;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_20_R3;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_20_R4;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R1;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R2;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R3;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R4;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R5;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R6;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v1_21_R7;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket.a;
@@ -11,10 +12,14 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final a ADD_PLAYER = a.valueOf("ADD_PLAYER");
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
if (packet instanceof ClientboundPlayerInfoRemovePacket remove) {
@@ -13,6 +13,10 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
/**
* Implementation provider using direct NMS code for 1.7.10.
*/
@@ -42,10 +46,21 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new TabListEntryTracker() {
@Override
public void onPacketSend(@NotNull Object packet) {
public void inject() {
}
@Override
public boolean containsEntry(@NotNull UUID uuid) {
return true;
}
@Override
public @NotNull Collection<UUID> getEntries() {
return Collections.emptyList();
}
};
}
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,7 +1,8 @@
package me.neznamy.tab.platforms.bukkit.v1_8_R3;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_8_R3.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -14,11 +15,15 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -41,8 +41,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,8 +1,9 @@
package me.neznamy.tab.platforms.bukkit.v1_9_R2;
import com.mojang.authlib.GameProfile;
import io.netty.channel.Channel;
import lombok.SneakyThrows;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import me.neznamy.tab.shared.util.ReflectionUtils;
import net.minecraft.server.v1_9_R2.PacketPlayOutPlayerInfo;
import net.minecraft.server.v1_9_R2.PacketPlayOutPlayerInfo.EnumPlayerInfoAction;
@@ -15,13 +16,17 @@ import java.util.List;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
private static final Field ACTION = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, EnumPlayerInfoAction.class);
private static final Field PLAYERS = ReflectionUtils.getOnlyField(PacketPlayOutPlayerInfo.class, List.class);
private static final Class<?> PlayerInfoData = Arrays.stream(PacketPlayOutPlayerInfo.class.getDeclaredClasses()).filter(c -> !c.isEnum() && c.getConstructors().length > 0).findFirst().get();
private static final Field PlayerInfoData_Profile = ReflectionUtils.getOnlyField(PlayerInfoData, GameProfile.class);
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
@SneakyThrows
@SuppressWarnings("unchecked")
@@ -51,8 +51,8 @@ public class NMSImplementationProvider implements ImplementationProvider {
@Override
@NotNull
public TabListEntryTracker newTabListEntryTracker() {
return new NMSTabListEntryTracker();
public TabListEntryTracker newTabListEntryTracker(@NotNull Player player) {
return new NMSTabListEntryTracker(getChannel(player));
}
@Override
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.bukkit.v26_1;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Implementation of TabListEntryTracker.
*/
public class NMSTabListEntryTracker extends TabListEntryTracker {
public class NMSTabListEntryTracker extends NettyTabListEntryTracker {
public NMSTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
+11 -47
View File
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("dev.architectury.loom")
id("dev.architectury.loom-no-remap")
}
repositories {
@@ -14,67 +14,31 @@ repositories {
maven("https://repo.papermc.io/repository/maven-public/") // Adventure
}
val minecraftVersion = "1.21.11"
val minecraftVersion = "26.1.2"
// Fabric API versions for each Minecraft version for easier backporting
// Official website (for updating in the future): https://fabricmc.net/develop/
val fabricApiVersions = mapOf(
"1.21.11" to "0.139.4+1.21.11",
"1.21.10" to "0.136.0+1.21.10",
"1.21.9" to "0.134.0+1.21.9",
"1.21.8" to "0.136.0+1.21.8",
"1.21.7" to "0.129.0+1.21.7",
"1.21.6" to "0.128.2+1.21.6",
"1.21.5" to "0.128.2+1.21.5",
"1.21.4" to "0.119.4+1.21.4",
"1.21.3" to "0.114.1+1.21.3",
"1.21.2" to "0.106.1+1.21.2",
"1.21.1" to "0.116.6+1.21.1",
"1.21" to "0.102.0+1.21",
"1.20.6" to "0.100.8+1.20.6",
"1.20.5" to "0.97.8+1.20.5",
"1.20.4" to "0.97.3+1.20.4",
"1.20.3" to "0.91.1+1.20.3",
"1.20.2" to "0.91.6+1.20.2",
"1.20.1" to "0.92.6+1.20.1",
"1.20" to "0.83.0+1.20",
"1.19.4" to "0.87.2+1.19.4",
"1.19.3" to "0.76.1+1.19.3",
"1.19.2" to "0.77.0+1.19.2",
"1.19.1" to "0.58.5+1.19.1",
"1.19" to "0.58.0+1.19",
"1.18.2" to "0.77.0+1.18.2",
"1.18.1" to "0.46.6+1.18",
"1.18" to "0.44.0+1.18",
"1.17.1" to "0.46.1+1.17",
"1.17" to "0.46.1+1.17",
"1.16.5" to "0.42.0+1.16",
"1.16.4" to "0.42.0+1.16",
"1.16.3" to "0.42.0+1.16",
"1.16.2" to "0.42.0+1.16",
"1.16.1" to "0.42.0+1.16",
"1.16" to "0.42.0+1.16"
"26.1.2" to "0.146.1+26.1.2"
)
dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings(loom.officialMojangMappings())
api(projects.shared)
modImplementation("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")
modImplementation("eu.pb4:placeholder-api:2.5.0+1.21.2")
modImplementation("net.fabricmc:fabric-loader:0.18.5")
modImplementation(fabricApi.module("fabric-lifecycle-events-v1", fabricApiVersions[minecraftVersion]))
modImplementation(fabricApi.module("fabric-networking-api-v1", fabricApiVersions[minecraftVersion]))
modImplementation(fabricApi.module("fabric-entity-events-v1", fabricApiVersions[minecraftVersion]))
modImplementation(fabricApi.module("fabric-command-api-v2", "0.58.0+1.19"))
modImplementation(fabricApi.module("fabric-command-api-v1", "0.77.0+1.18.2"))
implementation("me.lucko:fabric-permissions-api:0.7.0")
implementation("eu.pb4:placeholder-api:3.0.0+26.1")
implementation("net.fabricmc:fabric-loader:0.19.2")
implementation(fabricApi.module("fabric-lifecycle-events-v1", fabricApiVersions.getValue(minecraftVersion)))
implementation(fabricApi.module("fabric-networking-api-v1", fabricApiVersions.getValue(minecraftVersion)))
implementation(fabricApi.module("fabric-entity-events-v1", fabricApiVersions.getValue(minecraftVersion)))
implementation(fabricApi.module("fabric-command-api-v2", fabricApiVersions.getValue(minecraftVersion)))
}
loom.accessWidenerPath.set(file("src/main/resources/resources/tab.accesswidener"))
tasks {
compileJava {
options.release.set(21)
options.release.set(25)
}
validateAccessWidener {
enabled = true
@@ -26,6 +26,7 @@ public class FabricBossBar extends SafeBossBar<ServerBossEvent> {
@NotNull
public ServerBossEvent constructBossBar(@NotNull UUID id, @NotNull TabComponent title, float progress, @NotNull BarColor color, @NotNull BarStyle style) {
ServerBossEvent bar = new ServerBossEvent(
id,
title.convert(),
BossBarColor.valueOf(color.name()),
BossBarOverlay.valueOf(style.name())
@@ -3,7 +3,7 @@ package me.neznamy.tab.platforms.fabric;
import me.neznamy.tab.shared.TAB;
import me.neznamy.tab.shared.platform.EventListener;
import me.neznamy.tab.shared.platform.TabPlayer;
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents;
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityLevelChangeEvents;
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
import net.minecraft.server.level.ServerPlayer;
@@ -22,8 +22,7 @@ public class FabricEventListener implements EventListener<ServerPlayer> {
ServerPlayConnectionEvents.JOIN.register((connection, sender, server) -> {
TAB.getInstance().addTablistTracker(
connection.player.getUUID(),
connection.player.connection.connection.channel,
new FabricTabListEntryTracker()
new FabricTabListEntryTracker(connection.player.connection.connection.channel)
);
join(connection.player);
});
@@ -32,7 +31,7 @@ public class FabricEventListener implements EventListener<ServerPlayer> {
// respawning from death & taking end portal in the end does not call world change event
worldChange(newPlayer.getUUID(), FabricTAB.getLevelName(newPlayer.level()));
});
ServerEntityWorldChangeEvents.AFTER_PLAYER_CHANGE_WORLD.register(
ServerEntityLevelChangeEvents.AFTER_PLAYER_CHANGE_LEVEL.register(
(player, origin, destination) -> worldChange(player.getUUID(), FabricTAB.getLevelName(destination)));
}
@@ -7,6 +7,7 @@ import com.mojang.authlib.properties.PropertyMap;
import com.mojang.logging.LogUtils;
import eu.pb4.placeholders.api.PlaceholderContext;
import eu.pb4.placeholders.api.Placeholders;
import eu.pb4.placeholders.api.node.TextNode;
import lombok.NonNull;
import lombok.SneakyThrows;
import me.neznamy.tab.platforms.fabric.hook.FabricTabExpansion;
@@ -70,9 +71,9 @@ public record FabricPlatform(MinecraftServer server) implements BackendPlatform
PlaceholderManagerImpl manager = TAB.getInstance().getPlaceholderManager();
manager.registerPlayerPlaceholder(identifier,
p -> Placeholders.parseText(
Component.literal(identifier),
PlaceholderContext.of((ServerPlayer) p.getPlayer())
p -> Placeholders.SERVER_PLACEHOLDER_PARSER.parseComponent(
TextNode.convert(Component.literal(identifier)),
PlaceholderContext.of((ServerPlayer) p.getPlayer()).asParserContext()
).getString()
);
}
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.fabric;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Fabric implementation of TabListEntryTracker.
*/
public class FabricTabListEntryTracker extends TabListEntryTracker {
public class FabricTabListEntryTracker extends NettyTabListEntryTracker {
public FabricTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -1,16 +1,12 @@
package me.neznamy.tab.platforms.fabric.hook;
import eu.pb4.placeholders.api.PlaceholderContext;
import eu.pb4.placeholders.api.PlaceholderHandler;
import eu.pb4.placeholders.api.PlaceholderResult;
import eu.pb4.placeholders.api.Placeholders;
import eu.pb4.placeholders.api.*;
import lombok.Getter;
import me.neznamy.tab.shared.ProjectVariables;
import me.neznamy.tab.shared.TAB;
import me.neznamy.tab.shared.features.PlaceholderManagerImpl;
import me.neznamy.tab.shared.placeholders.expansion.TabExpansion;
import me.neznamy.tab.shared.platform.TabPlayer;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import java.util.Arrays;
@@ -60,9 +56,9 @@ public class FabricTabExpansion implements TabExpansion {
textBefore = text;
for (String placeholder : PlaceholderManagerImpl.detectPlaceholders(text)) {
text = text.replace(placeholder, TAB.getInstance().getPlaceholderManager().findReplacement(placeholder,
Placeholders.parseText(
Component.literal(placeholder),
PlaceholderContext.of(ctx.player())
Placeholders.SERVER_PLACEHOLDER_PARSER.parseComponent(
placeholder,
PlaceholderContext.of(ctx.player()).asParserContext()
).getString()));
}
} while (!textBefore.equals(text));
@@ -82,8 +78,8 @@ public class FabricTabExpansion implements TabExpansion {
});
}
private void registerPlaceholder(String identifier, PlaceholderHandler handler) {
Placeholders.register(Identifier.tryParse(ProjectVariables.PLUGIN_ID+":"+identifier), handler);
private void registerPlaceholder(String identifier, Placeholder.Handler<ServerPlaceholderContext, String> handler) {
Placeholders.registerServer(Identifier.tryParse(ProjectVariables.PLUGIN_ID+":"+identifier), handler);
}
@Override
+5 -3
View File
@@ -5,16 +5,18 @@
"name": "@name@",
"description": "@description@",
"authors": ["@author@"],
"contributors": ["credits"],
"contributors": ["@credits@"],
"environment": "server",
"entrypoints": {
"server": ["me.neznamy.tab.platforms.fabric.FabricTAB"]
},
"depends": {
"fabric-api-base": "*",
"java": ">=21",
"java": ">=25",
"minecraft": [
"1.21.11"
"26.1.2",
"26.1.1",
"26.1"
]
},
"recommends": {
@@ -1,4 +1,4 @@
accessWidener v2 named
accessWidener v2 official
# Channel
accessible field net/minecraft/server/network/ServerCommonPacketListenerImpl connection Lnet/minecraft/network/Connection;
+5 -41
View File
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("dev.architectury.loom")
id("dev.architectury.loom-no-remap")
}
repositories {
@@ -15,62 +15,26 @@ repositories {
maven("https://repo.papermc.io/repository/maven-public/") // Adventure
}
val minecraftVersion = "1.21.11"
val minecraftVersion = "26.1.2"
// Forge API versions for each Minecraft version for easier backporting
// Official website (for updating in the future): https://files.minecraftforge.net/net/minecraftforge/forge/
val forgeApiVersions = mapOf(
"1.21.11" to "1.21.11-61.0.2",
"1.21.10" to "1.21.10-60.1.5",
"1.21.9" to "1.21.9-59.0.5",
"1.21.8" to "1.21.8-58.1.11",
"1.21.7" to "1.21.7-57.0.3",
"1.21.6" to "1.21.6-56.0.9",
"1.21.5" to "1.21.5-55.1.4",
"1.21.4" to "1.21.4-54.1.11",
"1.21.3" to "1.21.3-53.1.6",
"1.21.2" to null,
"1.21.1" to "1.21.1-52.1.8",
"1.21" to "1.21-51.0.33",
"1.20.6" to "1.20.6-50.2.2",
"1.20.5" to null,
"1.20.4" to "1.20.4-49.2.2",
"1.20.3" to "1.20.3-49.0.2", // Broken dependencies
"1.20.2" to "1.20.2-48.1.0",
"1.20.1" to "1.20.1-47.4.9",
"1.20" to "1.20-46.0.14",
"1.19.4" to "1.19.4-45.4.2",
"1.19.3" to "1.19.3-44.1.23",
"1.19.2" to "1.19.2-43.5.1",
"1.19.1" to "1.19.1-42.0.9",
"1.19" to "1.19-41.1.0",
"1.18.2" to "1.18.2-40.3.11",
"1.18.1" to "1.18.1-39.1.2",
"1.18" to "1.18-38.0.17",
"1.17.1" to "1.17.1-37.1.1",
"1.17" to null,
"1.16.5" to "1.16.5-36.2.42",
"1.16.4" to "1.16.4-35.1.37",
"1.16.3" to "1.16.3-34.1.42",
"1.16.2" to "1.16.2-33.0.61",
"1.16.1" to "1.16.1-32.0.108", // Broken version
"1.16" to null,
// No one will most likely want anything older, lets stop here
"26.1.2" to "26.1.2-64.0.4"
)
dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings(loom.officialMojangMappings())
forge("net.minecraftforge:forge:${forgeApiVersions[minecraftVersion]}")
api(projects.shared)
compileOnly("net.luckperms:api:5.4")
compileOnly("net.luckperms:api:5.5")
}
loom.forge.accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
tasks {
compileJava {
options.release.set(21)
options.release.set(25)
}
withType<ShadowJar>().configureEach {
enabled = false
@@ -26,6 +26,7 @@ public class ForgeBossBar extends SafeBossBar<ServerBossEvent> {
@NotNull
public ServerBossEvent constructBossBar(@NotNull UUID id, @NotNull TabComponent title, float progress, @NotNull BarColor color, @NotNull BarStyle style) {
ServerBossEvent bar = new ServerBossEvent(
id,
title.convert(),
BossBarColor.valueOf(color.name()),
BossBarOverlay.valueOf(style.name())
@@ -19,8 +19,7 @@ public class ForgeEventListener implements EventListener<ServerPlayer> {
PlayerEvent.PlayerLoggedInEvent.BUS.addListener(event -> {
TAB.getInstance().addTablistTracker(
event.getEntity().getUUID(),
((ServerPlayer) event.getEntity()).connection.getConnection().channel(),
new ForgeTabListEntryTracker()
new ForgeTabListEntryTracker(((ServerPlayer) event.getEntity()).connection.getConnection().channel())
);
join((ServerPlayer) event.getEntity());
});
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.forge;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* Forge implementation of TabListEntryTracker.
*/
public class ForgeTabListEntryTracker extends TabListEntryTracker {
public class ForgeTabListEntryTracker extends NettyTabListEntryTracker {
public ForgeTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
+1 -1
View File
@@ -15,6 +15,6 @@ displayURL = "@website@"
[[dependencies.tab]]
modId = "minecraft"
mandatory = true
versionRange = "[1.21.11]"
versionRange = "[26.1, 26.1.2]"
ordering = "NONE"
side = "SERVER"
+23 -5
View File
@@ -48,8 +48,8 @@ val platformPaths = setOf(
val moddedPaths = setOf(
":fabric",
":neoforge",
":forge"
":neoforge"
// ":forge"
)
val platforms: List<Project> = platformPaths.map { rootProject.project(it) }
@@ -57,7 +57,7 @@ val moddedPlatforms: List<Project> = moddedPaths.map { rootProject.project(it) }
tasks {
shadowJar {
archiveFileName.set("TAB-${project.version}.jar")
archiveFileName.set("TAB v${project.version} - Fabric, NeoForge.jar")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
fun registerPlatform(project: Project, jarTask: AbstractArchiveTask) {
@@ -72,9 +72,27 @@ tasks {
}
moddedPlatforms.forEach { p ->
val task = p.tasks.named<Jar>("remapJar").get()
val task = p.tasks.named<Jar>("jar").get()
registerPlatform(p, task)
}
}
build.get().dependsOn(shadowJar)
val shadowJarVanilla = register<ShadowJar>("shadowJarVanilla") {
description = "Shadows only vanilla platforms, without any modded platforms that require Java 25+."
archiveFileName.set("TAB v${project.version} - Vanilla.jar")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
fun registerPlatform(project: Project, jarTask: AbstractArchiveTask) {
dependsOn(jarTask)
dependsOn(project.tasks.withType<Jar>())
from(zipTree(jarTask.archiveFile))
}
platforms.forEach { p ->
val task = p.tasks.named<ShadowJar>("shadowJar").get()
registerPlatform(p, task)
}
}
build.get().dependsOn(shadowJar, shadowJarVanilla)
}
+5 -22
View File
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("dev.architectury.loom")
id("dev.architectury.loom-no-remap")
}
repositories {
@@ -15,43 +15,26 @@ repositories {
maven("https://repo.papermc.io/repository/maven-public/") // Adventure
}
val minecraftVersion = "1.21.11"
val minecraftVersion = "26.1.2"
// NeoForge API versions for each Minecraft version for easier backporting
// Official website (for updating in the future): https://projects.neoforged.net/neoforged/neoforge
val neoforgeApiVersions = mapOf(
"1.21.11" to "21.11.0-beta",
"1.21.10" to "21.10.0-beta",
"1.21.9" to "21.9.16-beta",
"1.21.8" to "21.8.47",
"1.21.7" to "21.7.25-beta",
"1.21.6" to "21.6.20-beta",
"1.21.5" to "21.5.95",
"1.21.4" to "21.4.154",
"1.21.3" to "21.3.93",
"1.21.2" to "21.2.1-beta",
"1.21.1" to "21.1.209",
"1.21" to "21.0.167",
"1.20.6" to "20.6.138",
"1.20.5" to "20.5.21-beta",
"1.20.4" to "20.4.250",
"1.20.3" to "20.3.8-beta",
"1.20.2" to "20.2.93"
"26.1.2" to "26.1.2.17-beta"
)
dependencies {
minecraft("com.mojang:minecraft:${minecraftVersion}")
mappings(loom.officialMojangMappings())
neoForge("net.neoforged:neoforge:${neoforgeApiVersions[minecraftVersion]}")
api(projects.shared)
compileOnly("net.luckperms:api:5.4")
compileOnly("net.luckperms:api:5.5")
}
loom.neoForge.accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
tasks {
compileJava {
options.release.set(21)
options.release.set(25)
}
withType<ShadowJar>().configureEach {
enabled = false
@@ -26,6 +26,7 @@ public class NeoForgeBossBar extends SafeBossBar<ServerBossEvent> {
@NotNull
public ServerBossEvent constructBossBar(@NotNull UUID id, @NotNull TabComponent title, float progress, @NotNull BarColor color, @NotNull BarStyle style) {
ServerBossEvent bar = new ServerBossEvent(
id,
title.convert(),
BossBarColor.valueOf(color.name()),
BossBarOverlay.valueOf(style.name())
@@ -22,8 +22,7 @@ public class NeoForgeEventListener implements EventListener<ServerPlayer> {
eventBus.addListener((PlayerEvent.PlayerLoggedInEvent event) -> {
TAB.getInstance().addTablistTracker(
event.getEntity().getUUID(),
((ServerPlayer) event.getEntity()).connection.getConnection().channel(),
new NeoForgeTabListEntryTracker()
new NeoForgeTabListEntryTracker(((ServerPlayer) event.getEntity()).connection.getConnection().channel())
);
join((ServerPlayer) event.getEntity());
});
@@ -1,6 +1,7 @@
package me.neznamy.tab.platforms.neoforge;
import me.neznamy.tab.shared.platform.TabListEntryTracker;
import io.netty.channel.Channel;
import me.neznamy.tab.shared.platform.NettyTabListEntryTracker;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoRemovePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import org.jetbrains.annotations.NotNull;
@@ -10,7 +11,11 @@ import java.util.UUID;
/**
* NeoForge implementation of TabListEntryTracker.
*/
public class NeoForgeTabListEntryTracker extends TabListEntryTracker {
public class NeoForgeTabListEntryTracker extends NettyTabListEntryTracker {
public NeoForgeTabListEntryTracker(@NotNull Channel channel) {
super(channel);
}
@Override
public void onPacketSend(@NotNull Object packet) {
@@ -15,6 +15,6 @@ description = '''@description@'''
[[dependencies.tab]]
modId = "minecraft"
type = "required"
versionRange = "[1.21.11]"
versionRange = "[26.1, 26.1.2]"
ordering = "NONE"
side = "SERVER"
+1 -1
View File
@@ -67,5 +67,5 @@ include(":bukkit:v26_1")
include(":bungeecord")
include(":fabric")
include(":neoforge")
include(":forge")
//include(":forge")
include(":jar")
@@ -601,6 +601,7 @@ public class FeatureManager {
}
// Must be loaded after: PlayerList
TAB.getInstance().getDataManager().applyConfiguration(config.getGlobalPlayerList());
if (config.getGlobalPlayerList() != null) {
registerFeature(TabConstants.Feature.GLOBAL_PLAYER_LIST, new GlobalPlayerList(config.getGlobalPlayerList()));
}
@@ -1,6 +1,5 @@
package me.neznamy.tab.shared;
import io.netty.channel.Channel;
import lombok.Getter;
import lombok.Setter;
import me.neznamy.tab.api.TabAPI;
@@ -33,7 +32,6 @@ import org.yaml.snakeyaml.error.YAMLException;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
@@ -263,19 +261,11 @@ public class TAB extends TabAPI {
*
* @param player
* Player UUID
* @param channel
* Channel to inject the tracker to
* @param tracker
* TabList entry tracker
*/
public void addTablistTracker(@NotNull UUID player, @Nullable Channel channel, @NotNull TabListEntryTracker tracker) {
if (channel != null) {
if (!channel.pipeline().names().contains("packet_handler")) return; // Player got disconnected instantly or fake player
try {
channel.pipeline().addBefore("packet_handler", "TAB-TablistEntryTracker", tracker);
} catch (NoSuchElementException | IllegalArgumentException ignored) {
}
}
public void addTablistTracker(@NotNull UUID player, @NotNull TabListEntryTracker tracker) {
tracker.inject();
tablistTrackers.put(player, tracker);
}
@@ -133,6 +133,7 @@ public class TabConstants {
public static final String NAME_TAGS = "NameTags";
public static final String NAME_TAGS_COLLISION = "NameTagCollision";
public static final String NAME_TAGS_VISIBILITY = "NameTagVisibility";
public static final String NAME_TAGS_PREFIX_SUFFIX = "NameTagPrefixSuffix";
public static final String PLACEHOLDER_MANAGER = "PlaceholderManager";
public static final String PING_SPOOF = "PingSpoof";
public static final String PROXY_SUPPORT = "ProxySupport";
@@ -61,18 +61,18 @@ public class TabStyle {
/**
* Converts this style to EnumChatFormat for determining team color.
* Magic codes are preferred, since that is how they are defined in configuration as well.
* If both color and magic codes are used, color code is preferred as users will likely prefer it that way.
*
* @return EnumChatFormat to show to represent this style
*/
@NotNull
public EnumChatFormat toEnumChatFormat() {
if (color != null) return color.getLegacyColor();
if (Boolean.TRUE == bold) return EnumChatFormat.BOLD;
if (Boolean.TRUE == italic) return EnumChatFormat.ITALIC;
if (Boolean.TRUE == underlined) return EnumChatFormat.UNDERLINE;
if (Boolean.TRUE == strikethrough) return EnumChatFormat.STRIKETHROUGH;
if (Boolean.TRUE == obfuscated) return EnumChatFormat.OBFUSCATED;
if (color != null) return color.getLegacyColor();
return EnumChatFormat.RESET;
}
}
@@ -165,7 +165,7 @@ public class TabTextColor {
/**
* Returns the closest legacy color of this color object.
* If the color was defined in constructor, it's returned.
* Otherwise, the closest color is calculated the then returned.
* Otherwise, the closest color is calculated and then returned.
*
* @return closest legacy color
*/
@@ -75,21 +75,21 @@ public class NameTagCommand extends SubCommand {
if (action.equals("show")) {
if (viewer != null) {
teams.showNameTag(player, viewer, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (show)", !silent);
teams.getVisibilityManager().showNameTag(player, viewer, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (show)", !silent);
} else {
teams.showNameTag(player, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (show)", !silent);
teams.getVisibilityManager().showNameTag(player, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (show)", !silent);
}
} else if (action.equals("hide")) {
if (viewer != null) {
teams.hideNameTag(player, viewer, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (hide)", !silent);
teams.getVisibilityManager().hideNameTag(player, viewer, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (hide)", !silent);
} else {
teams.hideNameTag(player, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (hide)", !silent);
teams.getVisibilityManager().hideNameTag(player, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (hide)", !silent);
}
} else if (action.equals("toggle")) {
if (viewer != null) {
teams.toggleNameTag(player, viewer, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (toggle)", !silent);
teams.getVisibilityManager().toggleNameTag(player, viewer, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (toggle)", !silent);
} else {
teams.toggleNameTag(player, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (toggle)", !silent);
teams.getVisibilityManager().toggleNameTag(player, NameTagInvisibilityReason.HIDE_COMMAND, "Processing command (toggle)", !silent);
}
}
}
Loaded 100 of 121 files, more files were not shown because too many files have changed in this diff. Show more