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

Feature request: API #3

Open
SlimeDog opened this issue Apr 3, 2023 · 17 comments
Open

Feature request: API #3

SlimeDog opened this issue Apr 3, 2023 · 17 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@SlimeDog
Copy link

SlimeDog commented Apr 3, 2023

Please implement a public API so pHD can consider adding support.

@OliverSchlueter
Copy link
Member

I will do that in the comming days and keep you updated here.

@OliverSchlueter OliverSchlueter self-assigned this Apr 3, 2023
@OliverSchlueter OliverSchlueter added enhancement New feature or request documentation Improvements or additions to documentation labels Apr 3, 2023
@SlimeDog
Copy link
Author

SlimeDog commented Apr 3, 2023

The most important API access points are hologram name (ie., the list) and visibility. pHD utilizes a variety of factors to determine if a hologram should be visible to a particular player, so it needs to be able to set/unset visibility.

@OliverSchlueter
Copy link
Member

To get a hologram by name:

Hologram holo = FancyHolograms.getInstance().getHologramManager().getHologram("name");

To get a list of all holograms:

Collection<Hologram> holograms = FancyHolograms.getInstance().getHologramManager().getAllHolograms();

To show/spawn to a player

hologram.spawn(serverPlayer); // requires a ServerPlayer
HologramSpigotAdapter.fromHologram(hologram).spawn(player); // requires a normal Bukkit Player

To hide/remove to a player

hologram.remove(serverPlayer);
HologramSpigotAdapter.fromHologram(hologram).remove(player); // requires a normal Bukkit Player

There is no information stored which players see which holograms, but I'll make a HologramSpawnEvent and a HologramRemoveEvent, then you can in theory easily track that.

@SlimeDog
Copy link
Author

SlimeDog commented Apr 3, 2023

There is no information stored which players see which holograms, but I'll make a HologramSpawnEvent and a HologramRemoveEvent, then you can in theory easily track that.

pHD controls visibility for a player, based on these factors.

@OliverSchlueter
Copy link
Member

@SlimeDog do you need any more information or can this be closed?

@SlimeDog
Copy link
Author

SlimeDog commented Jun 5, 2023

Has FancyHolograms API covered all the listed items?

@SlimeDog
Copy link
Author

SlimeDog commented Jun 5, 2023

We're also waiting for more hologram features, like heads and items and blocks, but those are in addition to the pHD control features.

@keehl254
Copy link

keehl254 commented Aug 2, 2023

Would it be possible to adjust the build settings to include the API as a compile, or to combine the API project and the plugin project together?

The developer gradle repo is only allowing me to see the classes inside of the plugin branch; I can do FancyHologramsPlugin.get().getHologramsManager()
But I cannot see any of the events, the Hologram class, nor the HologramData class. As a result, I really can't use the API if I am not just manually adding the API package into my project.

image

The above image should have shown me a list of possible methods and fields inside the Hologram class, but as it cannot be found, it is blank.

@OliverSchlueter
Copy link
Member

Would it be possible to adjust the build settings to include the API as a compile, or to combine the API project and the plugin project together?

The developer gradle repo is only allowing me to see the classes inside of the plugin branch; I can do FancyHologramsPlugin.get().getHologramsManager() But I cannot see any of the events, the Hologram class, nor the HologramData class. As a result, I really can't use the API if I am not just manually adding the API package into my project.

image

The above image should have shown me a list of possible methods and fields inside the Hologram class, but as it cannot be found, it is blank.

Yes I'll see what I can do (I'm not the best with maven repos and gradle), thank you for telling

@OliverSchlueter
Copy link
Member

We're also waiting for more hologram features, like heads and items and blocks, but those are in addition to the pHD control features.

I just released the feature to have item & block holograms (https://github.com/FancyMcPlugins/FancyHolograms/releases/tag/v2.0.3)

Do you need anything else?

@SlimeDog
Copy link
Author

Do you need anything else?

I will test it over the next week or so. Thanks.

@SlimeDog
Copy link
Author

Do you need anything else?

Command(s) to convert from HolographicDisplays and DecentHolograms would be a big plus.

@SlimeDog
Copy link
Author

SlimeDog commented Nov 18, 2023

OK, I've done some testing (more to follow).

In what follows, HD=HolographicDisplays, DH=DecentHolograms, FH=FancyHolograms.

  • HD and DH holograms can contain different types of elements (eg., blocks and text). Is it possible for FH holograms to do so? I appreciate that this may well mean that internally an FH hologram contains multiple display elements.
  • If not, conversion would require creation of multiple FH holograms to support the different elements.
  • HD and DH hologram blocks and items bounce and rotate. Is it possible for FH blocks and items to do so?
  • HD and DH holograms location = center(x,y,z). FH holograms location = min(x,y,z). It would be nice to be consistent with them, to make conversion easier, or at least have the option.
  • An undo command would be helpful. Example use case:
    • fholo edit XYZZY position
    • Oops! I didn't mean to do that
    • Undo to place it back where it was
  • An info command would be useful, to show the current state of a hologram without having to review the hologram.yml content.

@SlimeDog
Copy link
Author

A hologram should be a collection of (one or more) related display entities of various types. For me, a typical hologram consists of a block in the middle (vertically) of several text lines.

@SlimeDog
Copy link
Author

I would like to add FancyHolograms support to pHD. It would be helpful if the issues noted above

  • combined holographic elements in a single hologram
  • bouncing/rotating block elements
  • centered location specification

could be addressed. Thanks for your consideration.

@OliverSchlueter
Copy link
Member

I would like to add FancyHolograms support to pHD. It would be helpful if the issues noted above

* combined holographic elements in a single hologram

* bouncing/rotating block elements

* centered location specification

could be addressed. Thanks for your consideration.

Combined hologram elements in one single holograms is not planned for now. You would need to position multiple holograms by yourself.

I'll think about bouncing & rotating item/block holograms. That could be pretty cool.

You can center the hologram on block with the moveTo command (x.5 y z.5)?

@SlimeDog
Copy link
Author

You can center the hologram on block with the moveTo command (x.5 y z.5)?

Yep. Works great. Thanks.

I'll think about bouncing & rotating item/block holograms. That could be pretty cool.

That would be great.

Combined hologram elements in one single holograms is not planned for now. You would need to position multiple holograms by yourself.

OK. Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants