Coder Social home page Coder Social logo

mrmicky-fr / fastboard Goto Github PK

View Code? Open in Web Editor NEW
450.0 450.0 52.0 68 KB

Lightweight packet-based scoreboard API for Bukkit plugins, with 1.7.10 to 1.20.6 support.

License: MIT License

Java 100.00%
api bukkit minecraft scoreboard scoreboard-api spigot

fastboard's People

Contributors

blubbarbs avatar mrmicky-fr avatar syldium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastboard's Issues

[Paper 1.20.5] Lib incompatible ?

Hello,
While trying to update my plugin to Paper 1.20.5 (build 6) with Fastboard 2.1.1, I have this error when a Player join:

[12:53:51 ERROR]: Could not pass event PlayerJoinEvent to PvPBox v2.7.0 (f35bdf0-dirty)
java.lang.ExceptionInInitializerError: null
        at PvPBox-2.7.0 (f35bdf0-dirty).jar/fr.x9nico.pvpbox.utils.scoreboard.FastBoardBase.<clinit>(FastBoardBase.java:197) ~[PvPBox-2.7.0 (f35bdf0-dirty).jar:?]
        at PvPBox-2.7.0 (f35bdf0-dirty).jar/fr.x9nico.pvpbox.listeners.players.PlayerJoin.join(PlayerJoin.java:48) ~[PvPBox-2.7.0 (f35bdf0-dirty).jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor20.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.5-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.5-R0.1-SNAPSHOT.jar:git-Paper-6]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.5-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.5.jar:git-Paper-6]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[paper-1.20.5.jar:git-Paper-6]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:627) ~[paper-api-1.20.5-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:347) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.network.ServerConfigurationPacketListenerImpl.handleConfigurationFinished(ServerConfigurationPacketListenerImpl.java:153) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:22) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.network.protocol.configuration.ServerboundFinishConfigurationPacket.handle(ServerboundFinishConfigurationPacket.java:13) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1515) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:198) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1492) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1415) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1381) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1242) ~[paper-1.20.5.jar:git-Paper-6]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[paper-1.20.5.jar:git-Paper-6]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ExceptionInInitializerError
        at PvPBox-2.7.0 (f35bdf0-dirty).jar/fr.x9nico.pvpbox.utils.scoreboard.FastBoardBase.<clinit>(FastBoardBase.java:85) ~[PvPBox-2.7.0 (f35bdf0-dirty).jar:?]
        ... 26 more
Caused by: java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 22
        at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55) ~[?:?]
        at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52) ~[?:?]
        at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213) ~[?:?]
        at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349) ~[?:?]
        at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4865) ~[?:?]
        at java.base/java.lang.String.substring(String.java:2834) ~[?:?]
        at java.base/java.lang.String.substring(String.java:2807) ~[?:?]
        at PvPBox-2.7.0 (f35bdf0-dirty).jar/fr.x9nico.pvpbox.utils.scoreboard.FastReflection.<clinit>(FastReflection.java:46) ~[PvPBox-2.7.0 (f35bdf0-dirty).jar:?]
        at PvPBox-2.7.0 (f35bdf0-dirty).jar/fr.x9nico.pvpbox.utils.scoreboard.FastBoardBase.<clinit>(FastBoardBase.java:85) ~[PvPBox-2.7.0 (f35bdf0-dirty).jar:?]
        ... 26 more
[12:53:51 INFO]: x9nico joined the game
[12:53:51 INFO]: x9nico[/127.0.0.1:56447] logged in with entity id 1 at ([world]-293.0867609123725, 44.0, -174.4639786386085)

There is my code =>

onEnable method:

 Bukkit.getScheduler().runTaskTimer(this, new ScoreBoardRunnable(this), 0L, 20L);

PlayerJoinEvent:

Player p = e.getPlayer();
        FastBoard board = new FastBoard(p) {
            public boolean hasLinesMaxLength() {
                return Via.getAPI().getPlayerVersion(getPlayer()) < ProtocolVersion.v1_13.getVersion();
            }
        };
Component sb_title = MiniMessage.miniMessage().deserialize(config.getString("sb_title"));
        board.updateTitle(sb_title);
        pvpBoxPlugin.getBoards().put(p.getUniqueId(), board);

(For your information, I tried with my p variable, with player uniqueid method, and I verified that I use the Fastboard class for Kiori Adventure, same error)

ScoreboardManager :

public void update(FastBoard board) {
        FileConfiguration config = pvpBoxPlugin.getConfig();
        int killStreaks = 0;
        if (pvpBoxPlugin.getKillStreak().containsKey(board.getPlayer().getUniqueId()))
            killStreaks = pvpBoxPlugin.getKillStreak().get(board.getPlayer().getUniqueId());
        Component sb_player = MiniMessage.miniMessage().deserialize(config.getString("sb_player").replace("{player}", board.getPlayer().getName()));
        Component sb_killstreaks = MiniMessage.miniMessage().deserialize(config.getString("sb_killstreaks").replace("{killStreaks}", Integer.toString(killStreaks)));
        Component sb_level = MiniMessage.miniMessage().deserialize(config.getString("sb_level").replace("{level}", String.valueOf(board.getPlayer().getLevel())));
        Component sb_ratio = MiniMessage.miniMessage().deserialize(config.getString("sb_ratio").replace("{ratio}", Double.toString(fixRatio(board.getPlayer()))));
        Component sb_deaths = MiniMessage.miniMessage().deserialize(config.getString("sb_deaths").replace("{deaths}", Integer.toString(board.getPlayer().getStatistic(Statistic.DEATHS))));
        Component sb_kills = MiniMessage.miniMessage().deserialize(config.getString("sb_kills").replace("{kills}", Integer.toString(board.getPlayer().getStatistic(Statistic.PLAYER_KILLS))));
        Component sb_ip_address = MiniMessage.miniMessage().deserialize(config.getString("sb_ip_adress"));
        board.updateLines(
                Component.empty(),
                sb_player,
                Component.empty(),
                sb_killstreaks,
                sb_level,
                sb_ratio,
                sb_deaths,
                sb_kills,
                Component.empty(),
                sb_ip_address
        );
    }

    private double fixRatio(Player player) {
        PlayerUtils playerUtils = new PlayerUtils(pvpBoxPlugin);
        return Math.round(playerUtils.getRatio(player) * 100.0D) / 100.0D;
    }

ScoreboardRunnable:

@Override
    public void run() {
        for (FastBoard boards : pvpBoxPlugin.getBoards().values()) {
            ScoreBoardManager scoreBoardManager = new ScoreBoardManager(pvpBoxPlugin);
            scoreBoardManager.update(boards);
        }
    }

Thanks :)

Kyori components support

When will the component support version be released? I saw that it is already done in pull request, but how do I implement it in my code?

Error

Got this error recently:

java.lang.ArrayIndexOutOfBoundsException: Index 22 out of bounds for length 22
    at fr.skytasul.quests.scoreboards.FastBoard.getColorCode(FastBoard.java:489) ~[?:?]
    at fr.skytasul.quests.scoreboards.FastBoard.sendScorePacket(FastBoard.java:415) ~[?:?]
    at fr.skytasul.quests.scoreboards.FastBoard.updateLines(FastBoard.java:287) ~[?:?]

If temporary overridden, scoreboard is hiding

Hey!
We are using FastBoard in our Plugin Ultra Scoreboards and I have a question you may can answer:

If a plugin temporary shows a scoreboard like a minigame plugin, what is the best way to detect the behavior
as soon as the fastboard can get activated again?

Thanks and greetings
Timo

Tab list?

This is a really great library, thanks for making it "thin" and easy to use. Would you consider adding support or making another library for tab list support?

Support removal of scoreboard numbers for 1.20.3+ clients

With the arrival of 1.20.3, the vanilla client gets support for modifying format of the scoreboard numbers, or removing them. It would be very nice to be able to remove them given that the main use of fastboard is just to show a list of strings, numbers are never used for anything, they simply used to be a requirement in older clients.

23w46a blogpost has the section for number formatting where it explains the new possibilities.

A method for getting Scoreboard

Hello, I'm planning to use FastBoard, but I would greatly appreciate a method to acquire FastBoard's Bukkit scoreboard so I can create teams and manage them. I've looked over the API, and it seems like FastBoard doesn't offer a way to get the scoreboard it creates.

FastBoard don't exist

🇫🇷
hey! quand je démarre mon serveur, paper me dit que que la classe fr.mrmicky.fastboard.FastBoard n'existe pas, pourtant je comprend pas j'ai bien importer le plugin dans mes libraries et la classe dans mon main, franchement je suis perdu :/ SI quelqu'un trouve la solution je suis preneur :)

🇬🇧
hi! when i start my server, paper tells me that the class fr.mrmicky.fastboard.FastBoard don't exist, btw i don't understand because i imported the plugin in my libs and my main.java, if someone could help me it will be cool :)

image
image

[Suggestion] Show original scoreboard

I would like to suggest a method or something where we could resend the player's original scoreboard if a FastBoard is disabled.

It would be nice if for some reason I am disabling a FastBoard for a player, the player can see their original server (or Bukkit) scoreboard.
This may be useful if I am using a scoreboard for just a mini game or something, and when the player is done the game they would see whatever scoreboard they previously had.

Thanks

Does not Exist

Hi,

Even after searching through the issue #23 I still couldn't install it using Maven and .jar directly
In pom.xml

<relocations> <relocation> <pattern>fr.mrmicky.fastboard</pattern> <shadedPattern>com.yourpackage.fastboard</shadedPattern> </relocation> </relocations> <createDependencyReducedPom>false</createDependencyReducedPom>
(I cant wrap it in a code block it bugs)

`

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.8.8-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>fr.mrmicky</groupId>
        <artifactId>fastboard</artifactId>
        <version>1.2.1</version>
    </dependency>
</dependencies>

`

image
image
image
image

If someone could help me

1.18 update

The aeeb871 commit has been released recently to fix an issue with 1.18, but the util version has not changed and nothing has been pushed to maven central.

I don't see scoreboard

Hello I tired add scoreboard to my plugin. I don't know why it can't see the scoreboard created by FastBoard and by the command.

Board#updateLines doesnt work

For some reason Board#updateLines doesn't seem to update the lines.
This was working about a week ago, I notice that a change was recently made, perhaps changes were made to the maven repo as well, and ultimately board#updateLines doesn't show a scoreboard for the player at all, even through a list full of strings get passed.

Bungee issue

I'm using this for a plugin, but there have been reports that players cannot login to the server when this is used in spigot server under a bungeecord (I mean, using bungeecord) As soon as the scoreboard is assigned, they are kicked from the server.

Any other report related to a issue similar to this one?

FastBoard kill other boards

FastBoard kill another thread from other boards, this "board" after delete, or create empty board, other boards from another plugins, stop shows :/ I think, your reflection solution very strong. I can't make out most, really important elements of the library to at least replace your error. Please fix this, or expand your comments on updateLines and sendObjectivePacket. Most important elements of this library stay uncommented.

Line is longer than 30 chars

Hello I'm switching from titlemanager to FastBoard but it throws this error

method FastBoard#updateLines called with ... threw a IllegalArgumentException: Line 10 is longer than 30 chars

Lines

            - '&7{now}
            - ''
            - '&8▪ &fNext Border: &a100'
            - '&8▪ &fPlayers left &a100/100'
            - '&8▪ &fKills &a{kills}'
            - ''
            - '    {up}'
            - ' {left}  {right} &fPlay zone'
            - '    {back}    {status}'
            - ''
            - '&c❤ &e{health} &f{player} &7(You)'
            - ''
            - '&8▪ &fSize {size}x{size}m'
            - ''
            - '&eplay.my-cool-server.net'

Line indexes

Is it possible to completely remove the indexes on the right side of the scoreboard?

Custom index

Hello, is it possible that you modify the system to allow custom number (the one in red) like in the minigames?
16177496252476885988035475347836

Add support for Adventure Components

This looks perfect, lightweight and just an API, should be built into Paper.

Would it be possible to integrate either the Adventure Components API or MiniMessage support into the plugin?

Thanks!

Title not work

         FastBoard scoreboard = new FastBoard(player);
          scoreboard.updateTitle(Component.text("test"));

Current: git-Purpur-2019 (MC: 1.20.1)*

  • You are running the latest version

Character limit questions / feature request

My server is running Paper 1.17, coupled with ViaVersion and ViaBackwards to support versions from 1.9 through 1.17.
When I connect to the server using a version older than 1.13, my scoreboard lines are cut off, but I'm pretty sure my lines are less than 30 characters long.

Does this limit include color codes?

While this limit cannot be circumvented, it would be great to have a feature allowing to switch to a smart mode when creating a FastBoard instance, a smart mode that would allow a line longer than 30 characters to be split across multiple lines while keeping the color code when sending data to past 1.13 versions?
This would keep the display unchanged for versions newer than 1.12 while still allowing older versions to display all desired data.

[Paper 1.20.4] Custom Scores incompatibles for Players < 1.20.4 (Log error)

Hello,

J'ai tenté d'expérimenter l'implémentation dans FB les scores persos.
Lorsque l'on utilise les scores custom de la 1.20.4, un joueur en version < se voit déconnecter de manière instantanée du serveur, et provoque une erreur dans la console avec ViaVersion + ViaBackwards.

Ne serait-il pas possible de "prévenir" ces cas de joueurs lors de l'usage de cette feature pour les joueurs < à la 1.20.4 ?

Voici le message d'erreur :

https://hastebin.com/share/kixufikawu.markdown

[EDIT 01/03/24] : J'ai tenté sans avoir les scores custom (avec la suppression de l'affichage des scores), ça fait quand même le message d'erreur. Je pense que ViaVersion + VB ne supporte pas ça ?

Add support for Minecraft 1.20.3

Hello,

Minecraft 1.20.3 is out, this version modifies the Scoreboard.
So I noticed that the Scoreboard appears, but without the lines...

The following exception occurs:
java.lang.RuntimeException: Unable to update scoreboard lines updateLines()

by calling the sendScorePacket()

Cause of exception:
Caused by: java.lang.IllegalAccessException: Can not set final java.lang.String field net.minecraft.network.protocol.game.PacketPlayOutScoreboardScore.a to java.lang.String

The method #sendScorePacket() will invoke the PACKET_SB_SCORE by allocating the necessary fields.
Except that the PacketPlayOutScoreboardScore has changed: it's no longer a class, but a record.

I didn't see any other changes, but regarding issue #41, when an Objective is created, a new parameter is present.

Honestly, this issue is here to point out that the library doesn't work (at least for me) in version 1.20.3, after which I didn't really investigate any further.

Hopefully it was useful and not the other way around ;)

Error when sending Custom number formatting to older clients

If you send a scoreboard with a custom number formatting to a client not using the 1.20.4 the client disconnect with this error
image
No logs in server or client console

Im using ViaBackwards, the server is native 1.20.4 and the client is in 1.19.4, same issue using a client in minecraft 1.20.2

ClassCastException during initialization

I copied everything to test how it works, and after pasting the code, I get the following message:

Could not pass event PlayerJoinEvent to BoardTest v1.0
org.bukkit.event.EventException: null
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.players.PlayerList.a(PlayerList.java:276) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.network.LoginListener.a(LoginListener.java:192) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.network.LoginListener.c(LoginListener.java:179) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.network.LoginListener.tick(LoginListener.java:74) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.network.NetworkManager.a(NetworkManager.java:246) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.network.ServerConnection.c(ServerConnection.java:172) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1321) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:438) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1202) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1035) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:303) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ExceptionInInitializerError
	at net.core.board.FastBoard.<clinit>(FastBoard.java:131) ~[?:?]
	at net.core.listeners.JoinedEvent.onJoin(JoinedEvent.java:90) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?]
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	... 15 more
Caused by: java.lang.ClassCastException: Cannot cast [Ljava.lang.Object; to java.lang.String
	at java.lang.Class.cast(Class.java:3818) ~[?:?]
	at net.core.board.FastBoard.<clinit>(FastBoard.java:90) ~[?:?]
	at net.core.listeners.JoinedEvent.onJoin(JoinedEvent.java:90) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?]
	at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.17.1.jar:3172-Spigot-610a8c0-99561c2]
	... 15 more

Objectives and below_name Collision

Hi, good day.

To summarize, I have a problem and as you read in the title, there is a collision between your API and the minecraft scoreboard objectives, in this case with below_name display slot. This is my code:

public static void showHealthbar(Player p, Main plugin) {

	if(p.getScoreboard() == null) {
		p.setScoreboard(Bukkit.getScoreboardManager().getNewScoreboard());
	}
			
	if(p.getScoreboard().getObjective("Health") != null) {
		p.getScoreboard().getObjective("Health").unregister();		
	}
			
	Objective healthbar = p.getScoreboard().registerNewObjective("Health", "health");
	healthbar.setDisplaySlot(DisplaySlot.BELOW_NAME);
			
	p.getScoreboard().getObjective("Health").setDisplayName(ChatColor.translateAlternateColorCodes('&', &b❤));
		
}

The problem is that when I use this method with a player, all online players see the same and that should not happen (I mean that only that player should see other players with the blue heart, nevertheless all players see the heart in blue) In the old API that I used, this didn't happen for that am sure that this is a compatibility problem of FastBoard.

So... How can I fix it? Or can you fix it?

Hide the filling up of the scoreboard?

When showing the Scoreboard to the player (using new Fastboard(player)), the user can see the board filling up as illustrated here:
GIF

Is there any way to circumvent that? Like filling up the board with data, and only then show it to the player?

Error on interacting with Scoreboard

Hey!
after your most recent changes our large community is getting the following issue:

java.lang.RuntimeException: Unable to update scoreboard title
        at me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.updateTitle(FastBoardBase.java:220) ~[UltraScoreboards.jar:?]
        at me.TechsCode.UltraScoreboards.scoreboards.FastBoard.updateTitle(FastBoard.java:71) ~[UltraScoreboards.jar:?]
        at me.TechsCode.UltraScoreboards.scoreboards.ScoreboardManager.lambda$start$5(ScoreboardManager.java:147) ~[UltraScoreboards.jar:?]
        at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
        at me.TechsCode.UltraScoreboards.scoreboards.ScoreboardManager.lambda$start$6(ScoreboardManager.java:114) ~[UltraScoreboards.jar:?]
        at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
        at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092) ~[?:?]
        at me.TechsCode.UltraScoreboards.scoreboards.ScoreboardManager.lambda$start$7(ScoreboardManager.java:114) ~[UltraScoreboards.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.1.jar:git-Paper-45]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.20.1.jar:git-Paper-45]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.20.1.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalStateException: This FastBoard is deleted
        at me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.sendPacket(FastBoardBase.java:537) ~[UltraScoreboards.jar:?]
        at me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.sendObjectivePacket(FastBoardBase.java:458) ~[UltraScoreboards.jar:?]
        at me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.updateTitle(FastBoardBase.java:218) ~[UltraScoreboards.jar:?]
        ... 13 more
[17:17:47 WARN]: java.lang.RuntimeException: Unable to delete scoreboard
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.delete(FastBoardBase.java:404)
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.ScoreboardManager.lambda$start$5(ScoreboardManager.java:120)
[17:17:47 WARN]:        at java.base/java.util.Optional.ifPresent(Optional.java:178)
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.ScoreboardManager.lambda$start$6(ScoreboardManager.java:114)
[17:17:47 WARN]:        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
[17:17:47 WARN]:        at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1092)
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.ScoreboardManager.lambda$start$7(ScoreboardManager.java:114)
[17:17:47 WARN]:        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101)
[17:17:47 WARN]:        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[17:17:47 WARN]:        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[17:17:47 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[17:17:47 WARN]:        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[17:17:47 WARN]:        at java.base/java.lang.Thread.run(Thread.java:833)
[17:17:47 WARN]: Caused by: java.lang.IllegalStateException: This FastBoard is deleted
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.sendPacket(FastBoardBase.java:537)
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.sendTeamPacket(FastBoardBase.java:507)
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.sendTeamPacket(FastBoardBase.java:492)
[17:17:47 WARN]:        at UltraScoreboards.jar//me.TechsCode.UltraScoreboards.scoreboards.FastBoardBase.delete(FastBoardBase.java:399)
[17:17:47 WARN]:        ... 12 more

You may wonder what we have changed? As it has worked before?
Well.. we haven't changed anything expect updating the Library to its newest version.

I hope you guys can help us, multiple hundreds of users are waiting for this to get fixed.

My Discord: techscode

Thank you in advance!
Timo

If the lines of board decrease, the client will be kicked

public static void sendBoard1(Player player) {
        if (!boards.containsKey(player)) {
            var board = new FastBoard(player);
            board.updateTitle("Test");
            boards.put(player, board);
        }
        var board = boards.get(player);
        board.updateLines(
                "",
                ""
                )
                )
        );
    }

public static void sendBoard2(Player player) {
        if (!boards.containsKey(player)) {
            var board = new FastBoard(player);
            board.updateTitle("Test");
            boards.put(player, board);
        }
        var board = boards.get(player);
        board.updateLines(
                ""
                )
                )
        );
    }
[16:42:34 ERROR]: [/139.226.16.222:31638|Kolleen] <-> DownstreamBridge <-> [Duels#1] - exception caught Type: FastDecoderException
[16:42:34 ERROR]: net.md_5.bungee.protocol.FastDecoderException: Error decoding packet ID(5b) Type(class net.md_5.bungee.protocol.packet.ScoreboardScore)
[16:42:34 ERROR]: Caused by: net.md_5.bungee.protocol.BadPacketException: Packet GAME:TO_CLIENT/91 (ScoreboardScore) larger than expected, extra bytes: 11

WaterFall Proxy, Paper Server, 1.20.1 Fabric Client
run sendBoard1 method and then run sendBoard2 method, the player will be kicked

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.