diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/UnicacityAddon.java b/core/src/main/java/com/rettichlp/unicacityaddon/UnicacityAddon.java index b4596e0b8..7b7ca99e8 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/UnicacityAddon.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/UnicacityAddon.java @@ -14,9 +14,9 @@ import com.rettichlp.unicacityaddon.base.teamspeak.TeamSpeakAPI; import com.rettichlp.unicacityaddon.controller.DeadBodyController; import com.rettichlp.unicacityaddon.controller.GuiController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import com.rettichlp.unicacityaddon.controller.ScreenshotController; import com.rettichlp.unicacityaddon.controller.SoundController; -import com.rettichlp.unicacityaddon.controller.TabListController; import com.rettichlp.unicacityaddon.controller.TransportController; import com.rettichlp.unicacityaddon.controller.WorldInteractionController; import com.rettichlp.unicacityaddon.core.generated.DefaultReferenceStorage; @@ -149,6 +149,10 @@ public DeadBodyController deadBodyController() { return controller().getDeadBodyController(); } + public PlayerListController playerListController() { + return controller().getPlayerListController(); + } + public ScreenshotController screenshotController() { return controller().getScreenshotController(); } @@ -157,10 +161,6 @@ public SoundController soundController() { return controller().getSoundController(); } - public TabListController tabListController() { - return controller().getTabListController(); - } - public TransportController transportController() { return controller().getTransportController(); } diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/badge/NoPushBadge.java b/core/src/main/java/com/rettichlp/unicacityaddon/badge/NoPushBadge.java index e4892d85e..23ee055e5 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/badge/NoPushBadge.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/badge/NoPushBadge.java @@ -1,7 +1,7 @@ package com.rettichlp.unicacityaddon.badge; import com.rettichlp.unicacityaddon.UnicacityAddon; -import com.rettichlp.unicacityaddon.base.config.tablist.TabListConfiguration; +import com.rettichlp.unicacityaddon.base.config.playerlist.PlayerListConfiguration; import com.rettichlp.unicacityaddon.base.registry.annotation.UCBadge; import net.labymod.api.client.entity.player.badge.renderer.BadgeRenderer; import net.labymod.api.client.gui.icon.Icon; @@ -32,8 +32,8 @@ public void render(Stack stack, float x, float y, NetworkPlayerInfo player) { @Override public boolean isVisible(NetworkPlayerInfo player) { - TabListConfiguration tabListConfiguration = this.unicacityAddon.configuration().tablist(); - return this.unicacityAddon.utilService().isUnicacity() && tabListConfiguration.enabled().get() && tabListConfiguration.afk().get() && Optional.ofNullable(player.getTeam()) + PlayerListConfiguration playerListConfiguration = this.unicacityAddon.configuration().playerlist(); + return this.unicacityAddon.utilService().isUnicacity() && playerListConfiguration.enabled().get() && playerListConfiguration.afk().get() && Optional.ofNullable(player.getTeam()) .map(ScoreboardTeam::getTeamName) .map(s -> s.equals("nopush")) .orElse(false); diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/DefaultUnicacityAddonConfiguration.java b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/DefaultUnicacityAddonConfiguration.java index 8ed56bcd4..feab370ee 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/DefaultUnicacityAddonConfiguration.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/DefaultUnicacityAddonConfiguration.java @@ -16,12 +16,12 @@ import com.rettichlp.unicacityaddon.base.config.message.MessageConfiguration; import com.rettichlp.unicacityaddon.base.config.nametag.DefaultNameTagConfiguration; import com.rettichlp.unicacityaddon.base.config.nametag.NameTagConfiguration; +import com.rettichlp.unicacityaddon.base.config.playerlist.DefaultPlayerListConfiguration; +import com.rettichlp.unicacityaddon.base.config.playerlist.PlayerListConfiguration; import com.rettichlp.unicacityaddon.base.config.reinforcement.DefaultReinforcementConfiguration; import com.rettichlp.unicacityaddon.base.config.reinforcement.ReinforcementConfiguration; import com.rettichlp.unicacityaddon.base.config.sloc.DefaultSlocConfiguration; import com.rettichlp.unicacityaddon.base.config.sloc.SlocConfiguration; -import com.rettichlp.unicacityaddon.base.config.tablist.DefaultTabListConfiguration; -import com.rettichlp.unicacityaddon.base.config.tablist.TabListConfiguration; import com.rettichlp.unicacityaddon.base.config.teamspeak.DefaultTeamSpeakConfiguration; import com.rettichlp.unicacityaddon.base.config.teamspeak.TeamSpeakConfiguration; import net.labymod.api.addon.AddonConfig; @@ -96,7 +96,7 @@ public class DefaultUnicacityAddonConfiguration extends AddonConfig implements U @SwitchSetting @SpriteSlot(y = 2) - private final DefaultTabListConfiguration tablist = new DefaultTabListConfiguration(); + private final DefaultPlayerListConfiguration playerlist = new DefaultPlayerListConfiguration(); @SwitchSetting @SpriteSlot(x = 1, y = 2) @@ -190,8 +190,8 @@ public TeamSpeakConfiguration teamspeak() { } @Override - public TabListConfiguration tablist() { - return this.tablist; + public PlayerListConfiguration playerlist() { + return this.playerlist; } @Override diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/UnicacityAddonConfiguration.java b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/UnicacityAddonConfiguration.java index d5eee2074..d74164c82 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/UnicacityAddonConfiguration.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/UnicacityAddonConfiguration.java @@ -8,9 +8,9 @@ import com.rettichlp.unicacityaddon.base.config.join.PasswordConfiguration; import com.rettichlp.unicacityaddon.base.config.message.MessageConfiguration; import com.rettichlp.unicacityaddon.base.config.nametag.NameTagConfiguration; +import com.rettichlp.unicacityaddon.base.config.playerlist.PlayerListConfiguration; import com.rettichlp.unicacityaddon.base.config.reinforcement.ReinforcementConfiguration; import com.rettichlp.unicacityaddon.base.config.sloc.SlocConfiguration; -import com.rettichlp.unicacityaddon.base.config.tablist.TabListConfiguration; import com.rettichlp.unicacityaddon.base.config.teamspeak.TeamSpeakConfiguration; import net.labymod.api.configuration.loader.property.ConfigProperty; @@ -63,7 +63,7 @@ public interface UnicacityAddonConfiguration { TeamSpeakConfiguration teamspeak(); - TabListConfiguration tablist(); + PlayerListConfiguration playerlist(); ConfigProperty despawnTime(); diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/tablist/DefaultTabListConfiguration.java b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/playerlist/DefaultPlayerListConfiguration.java similarity index 85% rename from core/src/main/java/com/rettichlp/unicacityaddon/base/config/tablist/DefaultTabListConfiguration.java rename to core/src/main/java/com/rettichlp/unicacityaddon/base/config/playerlist/DefaultPlayerListConfiguration.java index b56d42937..e1b71a2db 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/tablist/DefaultTabListConfiguration.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/playerlist/DefaultPlayerListConfiguration.java @@ -1,4 +1,4 @@ -package com.rettichlp.unicacityaddon.base.config.tablist; +package com.rettichlp.unicacityaddon.base.config.playerlist; import net.labymod.api.client.gui.screen.widget.widgets.input.SwitchWidget.SwitchSetting; import net.labymod.api.configuration.loader.Config; @@ -8,7 +8,7 @@ /** * @author RettichLP */ -public class DefaultTabListConfiguration extends Config implements TabListConfiguration { +public class DefaultPlayerListConfiguration extends Config implements PlayerListConfiguration { @SwitchSetting @ParentSwitch diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/tablist/TabListConfiguration.java b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/playerlist/PlayerListConfiguration.java similarity index 67% rename from core/src/main/java/com/rettichlp/unicacityaddon/base/config/tablist/TabListConfiguration.java rename to core/src/main/java/com/rettichlp/unicacityaddon/base/config/playerlist/PlayerListConfiguration.java index 244df2dc4..95c4305f1 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/base/config/tablist/TabListConfiguration.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/base/config/playerlist/PlayerListConfiguration.java @@ -1,11 +1,11 @@ -package com.rettichlp.unicacityaddon.base.config.tablist; +package com.rettichlp.unicacityaddon.base.config.playerlist; import net.labymod.api.configuration.loader.property.ConfigProperty; /** * @author RettichLP */ -public interface TabListConfiguration { +public interface PlayerListConfiguration { ConfigProperty enabled(); diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/controller/TabListController.java b/core/src/main/java/com/rettichlp/unicacityaddon/controller/PlayerListController.java similarity index 60% rename from core/src/main/java/com/rettichlp/unicacityaddon/controller/TabListController.java rename to core/src/main/java/com/rettichlp/unicacityaddon/controller/PlayerListController.java index 3d4763100..436772b06 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/controller/TabListController.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/controller/PlayerListController.java @@ -9,7 +9,9 @@ */ @Nullable @Referenceable -public abstract class TabListController { +public abstract class PlayerListController { - public abstract void orderTabList(UnicacityAddon unicacityAddon); + public abstract boolean isKeyPlayerListDown(); + + public abstract void orderPlayerList(UnicacityAddon unicacityAddon); } diff --git a/core/src/main/java/com/rettichlp/unicacityaddon/listener/EventRegistrationListener.java b/core/src/main/java/com/rettichlp/unicacityaddon/listener/EventRegistrationListener.java index 03c4c7af8..cfe7f89df 100644 --- a/core/src/main/java/com/rettichlp/unicacityaddon/listener/EventRegistrationListener.java +++ b/core/src/main/java/com/rettichlp/unicacityaddon/listener/EventRegistrationListener.java @@ -75,9 +75,10 @@ public void onKey(KeyEvent e) { UnicacityAddonConfiguration configuration = this.unicacityAddon.configuration(); if (state.equals(KeyEvent.State.PRESS) && this.unicacityAddon.utilService().isUnicacity()) { - if (key.equals(Key.TAB) && !Laby.references().chatAccessor().isChatOpen() && configuration.tablist().enabled().get() && configuration.tablist().sorted().get()) { + boolean isKeyPlayerListDown = this.unicacityAddon.playerListController().isKeyPlayerListDown(); + if (isKeyPlayerListDown && !Laby.references().chatAccessor().isChatOpen() && configuration.playerlist().enabled().get() && configuration.playerlist().sorted().get()) { this.unicacityAddon.utilService().debug("Sorting tab list"); - this.unicacityAddon.tabListController().orderTabList(this.unicacityAddon); + this.unicacityAddon.playerListController().orderPlayerList(this.unicacityAddon); return; } diff --git a/core/src/main/resources/assets/unicacityaddon/i18n/de_de.json b/core/src/main/resources/assets/unicacityaddon/i18n/de_de.json index b3b042403..d72f395a3 100644 --- a/core/src/main/resources/assets/unicacityaddon/i18n/de_de.json +++ b/core/src/main/resources/assets/unicacityaddon/i18n/de_de.json @@ -551,14 +551,14 @@ "name": "Support-Channel-betreten Nachricht" } }, - "tablist": { - "name": "Tabliste", + "playerlist": { + "name": "Spieler-Liste", "sorted": { - "name": "Sortierte Tabliste", - "description": "Sortiert die Tabliste nach Duty-Fraktionen, UC's, Buildern und aktiven Reports" + "name": "Sortierte Spieler-Liste", + "description": "Sortiert die Spieler-Liste nach Duty-Fraktionen, UC's, Buildern und aktiven Reports" }, "afk": { - "name": "AFK Tag in Tabliste", + "name": "AFK Tag in Spieler-Liste", "description": "Zeugt hinter AFK Spielern ein Icon an" } }, diff --git a/core/src/main/resources/assets/unicacityaddon/i18n/en_gb.json b/core/src/main/resources/assets/unicacityaddon/i18n/en_gb.json index a6a7dc203..222902999 100644 --- a/core/src/main/resources/assets/unicacityaddon/i18n/en_gb.json +++ b/core/src/main/resources/assets/unicacityaddon/i18n/en_gb.json @@ -551,11 +551,11 @@ "name": "Join support channel message" } }, - "tablist": { - "name": "Tab list", + "playerlist": { + "name": "Player List", "sorted": { - "name": "Sorted Tab List", - "description": "Sorts the tab list by duty factions, UC's, builders and active reports" + "name": "Sorted Player List", + "description": "Sorts the player list by duty factions, UC's, builders and active reports" }, "afk": { "name": "AFK Tag", diff --git a/core/src/main/resources/assets/unicacityaddon/i18n/en_us.json b/core/src/main/resources/assets/unicacityaddon/i18n/en_us.json index a0b4bdbc5..222902999 100644 --- a/core/src/main/resources/assets/unicacityaddon/i18n/en_us.json +++ b/core/src/main/resources/assets/unicacityaddon/i18n/en_us.json @@ -551,11 +551,11 @@ "name": "Join support channel message" } }, - "tablist": { - "name": "Tab List", + "playerlist": { + "name": "Player List", "sorted": { - "name": "Sorted Tab List", - "description": "Sorts the tab list by duty factions, UC's, builders and active reports" + "name": "Sorted Player List", + "description": "Sorts the player list by duty factions, UC's, builders and active reports" }, "afk": { "name": "AFK Tag", diff --git a/game-runner/src/v1_12_2/java/com/rettichlp/unicacityaddon/v1_12_2/VersionedTabListController.java b/game-runner/src/v1_12_2/java/com/rettichlp/unicacityaddon/v1_12_2/VersionedPlayerListController.java similarity index 86% rename from game-runner/src/v1_12_2/java/com/rettichlp/unicacityaddon/v1_12_2/VersionedTabListController.java rename to game-runner/src/v1_12_2/java/com/rettichlp/unicacityaddon/v1_12_2/VersionedPlayerListController.java index 69502af3c..6a3f0c9a6 100644 --- a/game-runner/src/v1_12_2/java/com/rettichlp/unicacityaddon/v1_12_2/VersionedTabListController.java +++ b/game-runner/src/v1_12_2/java/com/rettichlp/unicacityaddon/v1_12_2/VersionedPlayerListController.java @@ -2,8 +2,9 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; +import net.labymod.api.client.gui.screen.key.Key; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; import net.labymod.api.models.Implements; @@ -17,20 +18,28 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Optional; /** * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + int playerListKeyCode = Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode(); + return Optional.ofNullable(Laby.references().keyMapper().getKeyByKeyCode(playerListKeyCode)) + .map(Key::isPressed).orElse(false); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getMinecraft().world != null; diff --git a/game-runner/src/v1_16_5/java/com/rettichlp/unicacityaddon/v1_16_5/VersionedTabListController.java b/game-runner/src/v1_16_5/java/com/rettichlp/unicacityaddon/v1_16_5/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_16_5/java/com/rettichlp/unicacityaddon/v1_16_5/VersionedTabListController.java rename to game-runner/src/v1_16_5/java/com/rettichlp/unicacityaddon/v1_16_5/VersionedPlayerListController.java index 55c0f6365..bfc604606 100644 --- a/game-runner/src/v1_16_5/java/com/rettichlp/unicacityaddon/v1_16_5/VersionedTabListController.java +++ b/game-runner/src/v1_16_5/java/com/rettichlp/unicacityaddon/v1_16_5/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null; diff --git a/game-runner/src/v1_17_1/java/com/rettichlp/unicacityaddon/v1_17_1/VersionedTabListController.java b/game-runner/src/v1_17_1/java/com/rettichlp/unicacityaddon/v1_17_1/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_17_1/java/com/rettichlp/unicacityaddon/v1_17_1/VersionedTabListController.java rename to game-runner/src/v1_17_1/java/com/rettichlp/unicacityaddon/v1_17_1/VersionedPlayerListController.java index b70a277b6..e4a8c4695 100644 --- a/game-runner/src/v1_17_1/java/com/rettichlp/unicacityaddon/v1_17_1/VersionedTabListController.java +++ b/game-runner/src/v1_17_1/java/com/rettichlp/unicacityaddon/v1_17_1/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null; diff --git a/game-runner/src/v1_18_2/java/com/rettichlp/unicacityaddon/v1_18_2/VersionedTabListController.java b/game-runner/src/v1_18_2/java/com/rettichlp/unicacityaddon/v1_18_2/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_18_2/java/com/rettichlp/unicacityaddon/v1_18_2/VersionedTabListController.java rename to game-runner/src/v1_18_2/java/com/rettichlp/unicacityaddon/v1_18_2/VersionedPlayerListController.java index 460bfe413..8ebd3d808 100644 --- a/game-runner/src/v1_18_2/java/com/rettichlp/unicacityaddon/v1_18_2/VersionedTabListController.java +++ b/game-runner/src/v1_18_2/java/com/rettichlp/unicacityaddon/v1_18_2/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null; diff --git a/game-runner/src/v1_19_2/java/com/rettichlp/unicacityaddon/v1_19_2/VersionedTabListController.java b/game-runner/src/v1_19_2/java/com/rettichlp/unicacityaddon/v1_19_2/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_19_2/java/com/rettichlp/unicacityaddon/v1_19_2/VersionedTabListController.java rename to game-runner/src/v1_19_2/java/com/rettichlp/unicacityaddon/v1_19_2/VersionedPlayerListController.java index 2164224de..462d59aa8 100644 --- a/game-runner/src/v1_19_2/java/com/rettichlp/unicacityaddon/v1_19_2/VersionedTabListController.java +++ b/game-runner/src/v1_19_2/java/com/rettichlp/unicacityaddon/v1_19_2/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null; diff --git a/game-runner/src/v1_19_3/java/com/rettichlp/unicacityaddon/v1_19_3/VersionedTabListController.java b/game-runner/src/v1_19_3/java/com/rettichlp/unicacityaddon/v1_19_3/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_19_3/java/com/rettichlp/unicacityaddon/v1_19_3/VersionedTabListController.java rename to game-runner/src/v1_19_3/java/com/rettichlp/unicacityaddon/v1_19_3/VersionedPlayerListController.java index 8a5894fae..9db3a48b2 100644 --- a/game-runner/src/v1_19_3/java/com/rettichlp/unicacityaddon/v1_19_3/VersionedTabListController.java +++ b/game-runner/src/v1_19_3/java/com/rettichlp/unicacityaddon/v1_19_3/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null; diff --git a/game-runner/src/v1_19_4/java/com/rettichlp/unicacityaddon/v1_19_4/VersionedTabListController.java b/game-runner/src/v1_19_4/java/com/rettichlp/unicacityaddon/v1_19_4/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_19_4/java/com/rettichlp/unicacityaddon/v1_19_4/VersionedTabListController.java rename to game-runner/src/v1_19_4/java/com/rettichlp/unicacityaddon/v1_19_4/VersionedPlayerListController.java index 1fd577408..95b64d6dc 100644 --- a/game-runner/src/v1_19_4/java/com/rettichlp/unicacityaddon/v1_19_4/VersionedTabListController.java +++ b/game-runner/src/v1_19_4/java/com/rettichlp/unicacityaddon/v1_19_4/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null; diff --git a/game-runner/src/v1_20_1/java/com/rettichlp/unicacityaddon/v1_20_1/VersionedTabListController.java b/game-runner/src/v1_20_1/java/com/rettichlp/unicacityaddon/v1_20_1/VersionedPlayerListController.java similarity index 92% rename from game-runner/src/v1_20_1/java/com/rettichlp/unicacityaddon/v1_20_1/VersionedTabListController.java rename to game-runner/src/v1_20_1/java/com/rettichlp/unicacityaddon/v1_20_1/VersionedPlayerListController.java index 6aee19419..5bfeb25bb 100644 --- a/game-runner/src/v1_20_1/java/com/rettichlp/unicacityaddon/v1_20_1/VersionedTabListController.java +++ b/game-runner/src/v1_20_1/java/com/rettichlp/unicacityaddon/v1_20_1/VersionedPlayerListController.java @@ -2,7 +2,7 @@ import com.rettichlp.unicacityaddon.UnicacityAddon; import com.rettichlp.unicacityaddon.base.tab.TabPrefix; -import com.rettichlp.unicacityaddon.controller.TabListController; +import com.rettichlp.unicacityaddon.controller.PlayerListController; import net.labymod.api.Laby; import net.labymod.api.client.network.ClientPacketListener; import net.labymod.api.client.network.NetworkPlayerInfo; @@ -22,15 +22,20 @@ * @author RettichLP */ @Singleton -@Implements(TabListController.class) -public class VersionedTabListController extends TabListController { +@Implements(PlayerListController.class) +public class VersionedPlayerListController extends PlayerListController { @Inject - public VersionedTabListController() { + public VersionedPlayerListController() { } @Override - public void orderTabList(UnicacityAddon unicacityAddon) { + public boolean isKeyPlayerListDown() { + return Minecraft.getInstance().options.keyPlayerList.isDown(); + } + + @Override + public void orderPlayerList(UnicacityAddon unicacityAddon) { ClientPacketListener clientPacketListener = Laby.labyAPI().minecraft().getClientPacketListener(); Collection networkPlayerInfos = clientPacketListener != null ? clientPacketListener.getNetworkPlayerInfos() : Collections.emptyList(); assert Minecraft.getInstance().level != null;