Iridium-Development / IridiumSkyblock

IridiumSkyblock: Skyblock Redefined
GNU General Public License v3.0
118 stars 100 forks source link

Placeholders are missing for when you dont have an island #863

Open PeachesMLG opened 5 months ago

PeachesMLG commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

(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?)

RasulbekHak1mov commented 5 months ago

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

sh0inx commented 5 months ago

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