Guarmanda / LootChest

Plugin to reload chest with hologram, particles, and editing menu
GNU General Public License v3.0
9 stars 21 forks source link

Placeholders for time of next drop #54

Open TomLewis opened 10 months ago

TomLewis commented 10 months ago

Can we get placeholders that count down for the time of next drop for the specific chest for example %lootchest_countdown_CHESTNAME% would replace with 4 Hours, 30mins 20 seconds and it would be up to where we put them to update, for example CMI holograms let you set how often a hologram updates.

Guarmanda commented 10 months ago

This option already exist but is disabled by default in config because chests in disable chunks haves bugged holograms because of this.

TomLewis commented 10 months ago

We have bugged holograms anyway, I fully turned off holograms as I didnt know why they were just staying around and not being removed.

We also have bugged particles, which I dont really want to turn off as thats the only way to show that a chest is special.

Maybe the logic for cleaning up old particles & holograms needs to be looked at again.

Do you have docs for the placeholders and how to use them?

Guarmanda commented 6 months ago

particles are cleaned on server restard, they aren't saved at server stop. I really don't know how to handle these broken hologram. they are due to unloaded chunks and the problem partially comes from spigot itself.

TomLewis commented 6 months ago

An easy fix for holograms is to just use an API from another plugin, support multiple plugins!

For example CMI hologram feature has an API! I use another plugin called crate reloaded that uses CMI holograms as their holograms engine.

You could also support, holographic displays and decent holograms which are standalone hologram plugins with APIs.

As for the placeholders, do you have docs for them?

Guarmanda commented 6 months ago

https://www.spigotmc.org/resources/api-hologramlib.98899/

TomLewis commented 6 months ago

People most likely would never have heard or used that, I highly suggest just using an API for a plugin that's most likely already running on a server such as CMI.

Guarmanda commented 6 months ago

Reasons why I will not depend on CMI just to display holograms: CMI is a PAID plugin (15$) (This reason alone is sufficient) CMI has more than 300 commands, commands that are useless for my plugin CMI holograms has many features that... I don't need^^ Hologramlib is free and is an API itself, not a plugin. It is meant to be included in a plugin, without forcing a user to install it. That's exactly what I want The only problem of Hologramlib is that it depends on protocollib. I'll may try to include protocollib directly in my plugin, because I hate dependencies

TomLewis commented 6 months ago

Bloat.

Support them all, its just an API.

IF CMI, use CMI Else IF Hologramic displays use Holographic displays

etc etc your fallback can be having that API

i have had no problems with cmi holograms

this questions about placeholders tho?

Guarmanda commented 6 months ago

And coding 5 times the same thing?! well... no^^ but yes I will keep this ticket open anyway, because placeholder are definitelly something I have to do. The problem is, lootchests respawn time aren't really precise, and that's because of spigot itself: spigot scheduled tasks are sometimes executed 5 to 25 seconds later than their actual goal. But the countdown could still be in minutes

Guarmanda commented 6 months ago

fun fact: hologramlib has placeholder support

Guarmanda commented 6 months ago

Hologramlib works like a charm with lootchest, I already coded the thing; it's the end of bugged holograms, because they are maid with packets. I removed half of the classes from it, which were useless. The only concern is the protocollib dependency.