Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scoreboard Creation #79

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open

Scoreboard Creation #79

wants to merge 37 commits into from

Conversation

SamuSonoIo
Copy link

Hello! 👋

I noticed that many people, including myself, struggle with creating scoreboards for Minecraft plugins. So, I decided to add this feature to Twilight to make it easier for everyone!

The process of creating a scoreboard is fully explained in the README.md file, and I've made sure that everything is easy to use and well-explained (at least, I believe so).

With my feature, you can create either a Static or a Dynamic scoreboard, or even combine the two. For example, you can create a static scoreboard and then update only specific lines (though, I personally don't see much use for this, but it's possible!).

If there is something in the code that maybe isn't clean, or need a refactoring, let me know and i'll fix it up as soon as i can.

Thank you!

image

@Dawsson
Copy link
Member

Dawsson commented Dec 9, 2024

I love you

@SamuSonoIo
Copy link
Author

I love you too dawson

@Dawsson
Copy link
Member

Dawsson commented Dec 9, 2024

Is this the start of our relationship?

@SamuSonoIo
Copy link
Author

Yes😍

@Dawsson
Copy link
Member

Dawsson commented Dec 10, 2024

yea gl getting anyone to merge this within 2024 💀

@SamuSonoIo
Copy link
Author

🫠😭

@SamuSonoIo
Copy link
Author

SamuSonoIo commented Dec 11, 2024

I've found a small error while testing today,if anyone looks at this and wants to merge, please wait until my next message as I'm fixing this issue tomorrow

@ShreyasAyyengar
Copy link
Member

I've found a small error while testing today,if anyone looks at this and wants to merge, please wait until my next message as I'm fixing this issue tomorrow

If that's the case, make use of the 'Draft Pull Requests' feature to ensure that merging cannot happen if you're not ready to make changes.

Screenshot 2024-12-10 at 6 39 47 pm

@SamuSonoIo SamuSonoIo marked this pull request as draft December 11, 2024 13:35
@SamuSonoIo
Copy link
Author

Done, thank you.

@stephendotgg
Copy link
Member

@SamuSonoIo Please ping once ready to be merged again

Fixed README.md
Reworked the code a bit.
@joshbker
Copy link
Member

To answer question 5: Yes, right now i haven't really added a method to do it easily. I'll probably work on it soon then; for now to add a new line you would need to use the setAll or updateLines method again and re set it to the player i believe, but will find a solution.

For question num 6: Sure, shouldn't be to hard

You're still misunderstanding 5.

I'm talking about adding another Objective in another DisplaySlot, such as BELOW_NAME. This is bound to the org.bukkit.Scoreboard, no?

If someone wants to have for example, an Objective for player health display BELOW_NAME, currently they would have to choose between that and a TwilightScoreboard SIDEBAR.

Please correct me if I'm wrong, but that's how I understand it currently.

@joshbker
Copy link
Member

joshbker commented Dec 16, 2024

Also @SamuSonoIo, have you tested the example code from the README where it references player.name with more than 1 player online?

I'm not sure if I'm being stupid but I can't see how these scoreboards are per-player.

If I join then the scoreboard would say my name, then if you join after it would say your name for both of us I think.

@SamuSonoIo
Copy link
Author

Oh, I understand now.
For now, I've only implemented the SIDEBAR display and not the BELOW_NAME.
It is still bound to the org.bukkit.Scoreboard, as you said. When I started this project,
I didn't consider that use case, but I can add support for it.

@SamuSonoIo
Copy link
Author

@joshbker
I didn't test this with multiple player since i didn't have the chance.
But i guess if someone create the scoreboard instance every time someone joins the game every scoreboard should have it's own runnable so it's own name and it's own things.

@joshbker
Copy link
Member

Oh, I understand now. For now, I've only implemented the SIDEBAR display and not the BELOW_NAME. It is still bound to the org.bukkit.Scoreboard, as you said. When I started this project, I didn't consider that use case, but I can add support for it.

Alright, yes I think as a library we really need to support those kind of things.

@joshbker I didn't test this with multiple player since i didn't have the chance. But i guess if someone create the scoreboard instance every time someone joins the game every scoreboard should have it's own runnable so it's own name and it's own things.

You don't create a new scoreboard instance per player in the README:
image

@SamuSonoIo
Copy link
Author

Oh my bad then, i made an error in the readme.
Sorry

@SamuSonoIo
Copy link
Author

Will finish to fix everything tomorrow probably,
Thanks for the feedback <3
Anything else that could be useful in this?

@joshbker
Copy link
Member

Will finish to fix everything tomorrow probably, Thanks for the feedback <3 Anything else that could be useful in this?

I can't think of anything more at the moment, think if you/we address all of the thinggs we've spoken about so far then we'll be in a great position with this.

@SamuSonoIo SamuSonoIo marked this pull request as draft December 16, 2024 23:11
@SamuSonoIo
Copy link
Author

Hi @joshbker
What do you think about this for the below name?
(Don't mind the semicolon there i was testing around)
image
image

@SamuSonoIo
Copy link
Author

image
Hi!
Also works with multiple player with just one instance.

@SamuSonoIo
Copy link
Author

I'm also working on some TabList methods since people love to use them together.
image
I tried almost everything, there are 2 small issues i still need to fix (which i will fix after christmas) then i think it's good to go!

@joshbker
Copy link
Member

I'm also working on some TabList methods since people love to use them together. image I tried almost everything, there are 2 small issues i still need to fix (which i will fix after christmas) then i think it's good to go!

Awesome, thank you for all your hard work on this!

@SamuSonoIo SamuSonoIo marked this pull request as ready for review January 10, 2025 23:24
@SamuSonoIo
Copy link
Author

Hey!
I've been working on this for a while, and I think it's finally good to go.
I updated the ReadMe and added some examples too.

I basically remade everything, now the entire scoreboard system is in one class, and it only has the methods that are actually needed, no unnecessary ones, so everything is nice and clean.
I took some inspiration from FastBoard since people seem to really like that API...

That's about it!

Forgot to add the player to the Map in the ReadME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants