mirror of
https://github.com/NEZNAMY/TAB.git
synced 2026-11-12 20:22:01 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff6ba6a8e9 | ||
|
|
ce3485c823 | ||
|
|
90a99d3a79 | ||
|
|
7248dc4fef | ||
|
|
d704db55fa | ||
|
|
0f581e47b1 |
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ plugins {
|
||||
|
||||
allprojects {
|
||||
group = "me.neznamy"
|
||||
version = "5.0.0"
|
||||
version = "5.0.1"
|
||||
description = "An all-in-one solution that works"
|
||||
|
||||
ext.set("id", "tab")
|
||||
|
||||
@@ -294,6 +294,11 @@ public class BukkitPlatform implements BackendPlatform {
|
||||
return TabListBase.getInstance().apply((BukkitTabPlayer) player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsListOrder() {
|
||||
return serverVersion.getNetworkId() >= ProtocolVersion.V1_21_2.getNetworkId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public GroupManager detectPermissionPlugin() {
|
||||
|
||||
@@ -196,8 +196,7 @@ public class BungeePlatform extends ProxyPlatform {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ProtocolVersion getServerVersion() {
|
||||
return ProtocolVersion.V1_21_2;
|
||||
public boolean supportsListOrder() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
api(projects.shared)
|
||||
minecraft("com.mojang:minecraft:1.21.2")
|
||||
minecraft("com.mojang:minecraft:1.21.3")
|
||||
mappings(loom.officialMojangMappings())
|
||||
modImplementation("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")
|
||||
modImplementation("net.fabricmc:fabric-loader:0.15.9")
|
||||
|
||||
@@ -147,6 +147,11 @@ public class FabricPlatform implements BackendPlatform {
|
||||
return new FabricTabList((FabricTabPlayer) player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsListOrder() {
|
||||
return serverVersion.getNetworkId() >= ProtocolVersion.V1_21_2.getNetworkId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTPS() {
|
||||
return -1; // Not available
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"1.18", "1.18.1", "1.18.2",
|
||||
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
|
||||
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6",
|
||||
"1.21", "1.21.1", "1.21.2"
|
||||
"1.21", "1.21.1", "1.21.2", "1.21.3"
|
||||
]
|
||||
},
|
||||
"recommends": {
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public enum ProtocolVersion {
|
||||
|
||||
UNKNOWN,
|
||||
V1_21_3 (768),
|
||||
V1_21_2 (768),
|
||||
V1_21_1 (767),
|
||||
V1_21 (767),
|
||||
|
||||
@@ -470,9 +470,8 @@ public class Converter {
|
||||
* Config file
|
||||
*/
|
||||
public void convert419to500(@NotNull ConfigurationFile config) {
|
||||
if (config.hasConfigOption("scoreboard-teams.unlimited-nametag-mode")) {
|
||||
if (config.removeOption("scoreboard-teams.unlimited-nametag-mode")) {
|
||||
TAB.getInstance().getPlatform().logInfo(TabComponent.fromColoredText(EnumChatFormat.YELLOW + "Performing configuration conversion from 4.1.9 to 5.0.0"));
|
||||
config.removeOption("scoreboard-teams.unlimited-nametag-mode");
|
||||
config.removeOption("scoreboard.respect-other-plugins");
|
||||
}
|
||||
if (!config.hasConfigOption("global-playerlist.update-latency")) {
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ public class LayoutConfiguration extends ConfigurationSection {
|
||||
|
||||
public String getEntryName(@NotNull TabPlayer viewer, int slot, boolean teamsEnabled) {
|
||||
boolean v1_21_2Plus = viewer.getVersion().getNetworkId() >= ProtocolVersion.V1_21_2.getNetworkId() &&
|
||||
TAB.getInstance().getPlatform().getServerVersion().getNetworkId() >= ProtocolVersion.V1_21_2.getNetworkId();
|
||||
TAB.getInstance().getPlatform().supportsListOrder();
|
||||
if (viewer.getVersion().getNetworkId() >= ProtocolVersion.V1_19_3.getNetworkId() && !v1_21_2Plus) {
|
||||
if (teamsEnabled) {
|
||||
return "|slot_" + (10+slotTranslator.apply(slot));
|
||||
|
||||
@@ -45,7 +45,7 @@ public class LayoutPattern extends RefreshableFeature implements Layout {
|
||||
|
||||
public void addGroup(@NotNull String name, @Nullable String condition, int[] slots) {
|
||||
groups.add(new GroupPattern(name, condition, Arrays.stream(slots).filter(slot -> !fixedSlots.containsKey(slot)).toArray()));
|
||||
if (condition != null) addUsedPlaceholder(TabConstants.Placeholder.condition(condition));
|
||||
if (condition != null) addUsedPlaceholder(TabConstants.Placeholder.condition(Condition.getCondition(condition).getName()));
|
||||
}
|
||||
|
||||
public boolean isConditionMet(@NotNull TabPlayer p) {
|
||||
|
||||
@@ -175,12 +175,12 @@ public interface Platform {
|
||||
TabList createTabList(@NotNull TabPlayer player);
|
||||
|
||||
/**
|
||||
* Returns server version. On proxies returns latest supported version by the version used as dependency.
|
||||
* Returns {@code true} if server is able to use {@code listOrder} field in tablist (1.21.2+). Returns {@code false}
|
||||
* if server is running below this version (backend) or server API does not support it yet.
|
||||
*
|
||||
* @return server version on backend, latest supported version on proxies
|
||||
* @return {@code true} if server is able to use {@code listOrder} tablist field, {@code false} if not
|
||||
*/
|
||||
@NotNull
|
||||
ProtocolVersion getServerVersion();
|
||||
boolean supportsListOrder();
|
||||
|
||||
/**
|
||||
* Returns {@code true} if the viewer can see the target, {@code false} otherwise.
|
||||
|
||||
@@ -136,6 +136,11 @@ public class SpongePlatform implements BackendPlatform {
|
||||
return new SpongeTabList((SpongeTabPlayer) player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsListOrder() {
|
||||
return false; // Sponge 7 only goes up to 1.12.2
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTPS() {
|
||||
return Sponge.getServer().getTicksPerSecond();
|
||||
|
||||
@@ -135,6 +135,11 @@ public class SpongePlatform implements BackendPlatform {
|
||||
return new SpongeTabList((SpongeTabPlayer) player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsListOrder() {
|
||||
return false; // TODO when they add API
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTPS() {
|
||||
return Sponge.server().ticksPerSecond();
|
||||
|
||||
@@ -180,9 +180,8 @@ public class VelocityPlatform extends ProxyPlatform {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ProtocolVersion getServerVersion() {
|
||||
return ProtocolVersion.V1_21_1;
|
||||
public boolean supportsListOrder() {
|
||||
return false; // TODO when they add API
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user