IridiumSkyblock icon indicating copy to clipboard operation
IridiumSkyblock copied to clipboard

Placeholders are missing for when you dont have an island

Open PeachesMLG opened this issue 1 year ago • 4 comments

The Placeholders between when you have an island, and dont have an island is different

https://github.com/Iridium-Development/IridiumSkyblock/blob/master/src/main/java/com/iridium/iridiumskyblock/placeholders/IslandPlaceholderBuilder.java

Extra bonus points if we can think about how to stop this in the future, add some unit tests? recode it somehow?

PeachesMLG avatar Jun 10 '24 19:06 PeachesMLG

Bit of extra info, we call this method here:

    @Override
    public List<Placeholder> getPlaceholders(Optional<Island> optional) {
        return optional.isPresent() ? getPlaceholders(optional.get()) : defaultPlaceholders;
    }

Which then calls two different methods, one with an Island, and the other for if there is no island present. Which means we have two lists to maintain, and these two lists have differences in them now which is the issue.

So if you have a PAPI plugin (e.g. a scoreboard) a placeholder e.g. island_enhancement_size_level would work if I have an island, however if I dont have an island, instead of showing N/A it wont process anything and will stay as %iridiumskyblock_island_enhancement_size_level

PeachesMLG avatar Jun 10 '24 19:06 PeachesMLG

(Also, make sure there are no duplicated Placeholders in this list, e.g. island_visitors, also extra bonus brownie points for how we can prevent this, again maybe unit tests?)

PeachesMLG avatar Jun 10 '24 19:06 PeachesMLG

i want to add the command "/is go" to my server, if it type the command it should go to the island, if the island doesn't exist then the island should be created

Can you help me

hakimovdev avatar Jun 22 '24 21:06 hakimovdev

  1. this is not related to the current issue
  2. if you need help, join our discord server and head to #skyblock, we can help you there
  3. if you do not want to use discord, create a NEW issue and follow the issue guidelines

sh0inx avatar Jun 22 '24 21:06 sh0inx