Giter Club home page Giter Club logo

sidebarlib's People

Contributors

andrei1058 avatar jt122406 avatar tom18314 avatar tomkeuper avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sidebarlib's Issues

Team group

Group players on the same team if wanted. Will give a ordered tab on games like bedwars

PlaceholderAPI takes a second to load on first join and doesnt format if it has characters in front.

When you join a server with a scoreboard the papi placeholders take a second to load in and will first show the full string.
The placeholder shown in the video is %vault_eco_balance_formatted% but it will happen with any placeholder.

https://youtu.be/w848qyXOFJc

Text in front stops the placeholders from loading completly.
image
After going into an arena and leaving again it does work:
image

Bedwars version: 23.2.2-BETA3 (up untill commit 52f4e63ed196cac0b940b6f9cd4c4d81466ffe27 )
Server version 1.8.8

Mc 1.18, 1.19 r2 and 1.17 support bug

Some variables are not initialized throwing a NPE

[13:00:58 ERROR]: Could not pass event PlayerJoinEvent to BedWars1058 v23.10.1-SNAPSHOT
java.lang.NullPointerException: Cannot invoke "net.minecraft.network.chat.ChatComponentText.h()" because "this.displayNameComp" is null
	at com.andrei1058.bedwars.libs.sidebar.v1_18_R2.SidebarImpl$NarniaSidebarObjective.refreshTitle(SidebarImpl.java:86) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.libs.sidebar.WrappedSidebar.<init>(WrappedSidebar.java:47) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.libs.sidebar.v1_18_R2.SidebarImpl.<init>(SidebarImpl.java:30) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.libs.sidebar.v1_18_R2.ProviderImpl.createSidebar(ProviderImpl.java:27) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.libs.sidebar.SidebarManager.createSidebar(SidebarManager.java:91) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.sidebar.BwSidebar.setContent(BwSidebar.java:93) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.sidebar.SidebarService.giveSidebar(SidebarService.java:222) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.andrei1058.bedwars.listeners.joinhandler.JoinListenerMultiArena.onJoin(JoinListenerMultiArena.java:91) ~[bedwars-plugin-23.10.1-SNAPSHOT.jar:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor101.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:git-Paper-379]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:669) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
	at net.minecraft.server.players.PlayerList.postChunkLoadJoin(PlayerList.java:363) ~[paper-1.18.2.jar:git-Paper-379]
	at net.minecraft.server.players.PlayerList.lambda$placeNewPlayer$1(PlayerList.java:305) ~[paper-1.18.2.jar:git-Paper-379]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.tick(ServerGamePacketListenerImpl.java:305) ~[?:?]
	at net.minecraft.network.Connection.tick(Connection.java:567) ~[?:?]
	at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:231) ~[?:?]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1623) ~[paper-1.18.2.jar:git-Paper-379]
	at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:483) ~[paper-1.18.2.jar:git-Paper-379]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1456) ~[paper-1.18.2.jar:git-Paper-379]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226) ~[paper-1.18.2.jar:git-Paper-379]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-379]
	at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Concurrent modification on async title refresh

Newly implemented placeholders in title causes a concurrent exception:

[12:47:23 WARN]: Exception in thread "Craft Scheduler Thread - 79"
[12:47:23 WARN]: org.apache.commons.lang.UnhandledException: Plugin BedWars1058 v23.10-SNAPSHOT generated an exception while executing task 17
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
        at org.github.paperspigot.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:23)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.util.ConcurrentModificationException
        at java.base/java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:977)
        at java.base/java.util.LinkedList$ListItr.next(LinkedList.java:899)
        at com.andrei1058.bedwars.libs.sidebar.WrappedSidebar.applyLinePlaceholders(WrappedSidebar.java:135)
        at com.andrei1058.bedwars.libs.sidebar.WrappedSidebar.parsePlaceholders(WrappedSidebar.java:162)
        at com.andrei1058.bedwars.libs.sidebar.v1_8_R3.SidebarImpl$NarniaSidebarObjective.getDisplayName(SidebarImpl.java:82)
        at net.minecraft.server.v1_8_R3.PacketPlayOutScoreboardObjective.<init>(SourceFile:25)
        at com.andrei1058.bedwars.libs.sidebar.v1_8_R3.SidebarImpl$NarniaSidebarObjective.sendUpdate(SidebarImpl.java:96)
        at com.andrei1058.bedwars.libs.sidebar.WrappedSidebar.refreshTitle(WrappedSidebar.java:178)
        at com.andrei1058.bedwars.sidebar.SidebarService.lambda$refreshTitles$0(SidebarService.java:165)
        at java.base/java.util.HashMap.forEach(HashMap.java:1429)
        at com.andrei1058.bedwars.sidebar.SidebarService.refreshTitles(SidebarService.java:165)
        at com.andrei1058.bedwars.sidebar.thread.RefreshTitleTask.run(RefreshTitleTask.java:28)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
        ... 4 more
  • Add possibility to use different collection types on placeholders to prevent async issues

Score Placeholders

With MC 1.20.3 implementation we have added a experimental implementation of SidebarLine.

  • Create a better implementation for ScoredLine with eventual concatenation to the prefix/ suffix in versions that are not supported

Player List optimizations

#getPrefix and #getSuffix can be improved since it is clonned code so make an util or smth with string limit in input and that should be it.

Tab improvements & animations

  • Extend AnimatedLine to all sidebar
  • Extend AnimatedLine to Tab
  • Allow multi lines in Tab
  • Fix PAPI support
  • Fix issue where health shows up as hearts on 1.8 and 1.12

Unnessecary Sidebar updates??

Hello, i noticed in our server there was alot of cpu-time going to sending scoreboard (in Bedwars1058) so which at time i thought it was normal.

I looked into the source and i saw that the plugin sends alot of unnessecary packets, i fixed it by checking prefix and suffix before and after setting content which is already a huge improvement as for my case the only thing changing from packet to packet is Sidebar.suffix and Sidebar.prefix.

Although this change worked nicely for my case, It needs a look from you as developers that uses your library may implement their own ScoreLine which will cause unexpected behavior if we are just checking for prefix and suffix.

My Patch:

    public void refreshPlaceholders() {
        for (ScoreLine str : this.lines) {
            if (str.text.isHasPlaceholders()) {
                // Some code here in parsing content
                
                String oldSuffix = str.suffix;
                String oldPrefix = str.prefix;
                str.setContent(content);

                // ignore Intellij Idea warning if present
                if (!oldSuffix.equals(str.suffix) || !oldPrefix.equals(str.prefix)) { 
                    str.sendUpdate();
                }
            }
        }
    }

This is old version of bw1058, But its equivilant to https://github.com/andrei1058/SiderbarLib/blob/6731c0aca53cf0390b14a08f9e55966bdf1faee1/sidebar-base/src/main/java/com/andrei1058/spigot/sidebar/WrappedSidebar.java#L138-L145

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.