Added methods to Hologram to improve changing the lines#79
Added methods to Hologram to improve changing the lines#79ThomasWega wants to merge 3 commits intodenmeh:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds methods to the Hologram class to improve management of hologram lines when the number of lines changes. The PR introduces functionality to update existing lines and completely replace the line collection with new lines.
- Added
updateLines()method to update all existing lines - Added
replaceLines()method to replace the entire line collection with a new set of lines - Enhanced API clarity by adding
@NotNullannotations to method parameters and return types
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Any thoughts? @unldenis |
|
Thanks for the contribution, sorry but I was quite busy and I tried Copilot also for PR but it didn't give useful info. Thanks for the @ One of the most difficult things is the yOffset, at the beginning I had loaders but perhaps it is better customizable in this way. I left you only a small comment, I have to test it but I think it's fine and then I merge it. |
|
Hey. Apologies for forgetting about this. What note have you left me please? If there's anything more to do, I'll do it so we can get this merged finally :D |
Hey. First of all thanks for adding the per-player function to the lines. That was a great addition.
I however found that if I ever want to replace the amount of lines in a hologram it starts getting a bit messy and I wasn't really able to do it. If the amount of lines were the same I could just use the function and update the lines to whatever I need but what if the amount is different? I start with 2 lines and then I need to update to 3 lines with different text.
So in this commit I've address this issue of mine and also just added few @NotNull for better API clarity.
Now, I'm not considering this to be a final version. While I tested it and it seems to work I'd definitely want at least an opinion of one other person first and him testing it as well.
This is how the usage would look. I'm also wondering if we can add default offset and just keep it optional if someone wants it different?
Usage example
I'm also thinking if this can be done in a better and more customizable way or if this is enough? Just looking for a feedback first. I'm happy to do any changes needed as I use this util in all my projects so I'm only happy to give back some of the time the existence of this has saved me.