Solved SpigotMC update API (update checker) not working?

Discussion in 'Spigot Plugin Development' started by Vengine, Jul 26, 2021.

Thread Status:
Not open for further replies.
  1. Vengine

    Vengine Previously SkillCode

    Hey, I created an update checker for my plugin, but it always returns 3.0.2.4, even though I released version 3.0.2.5 3 hours ago. Does anyone know what the reason is? Thanks!
    Code (Java):
    private void getVersion(final @NotNull Consumer<String> consumer) {
            Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
                try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + Constants.RESOURCE_ID).openStream(); Scanner scanner = new Scanner(inputStream)) {
                    if (scanner.hasNext()) {
                        consumer.accept(scanner.next());
                    }
                } catch (IOException exception) {
                    plugin.getLogger().warning(String.format(Constants.UPDATE_CHECKER_ERROR, exception.getClass().getSimpleName()));
                }
            });
        }
    [​IMG]
     
  2. Which is the resource ID?
     
  3. Vengine

    Vengine Previously SkillCode

    93927
     
  4. The API is returning the right version, so it must be a problem on your side. Are you sure you updated the plugin (recompiling ecc)? You could try to delete the jar file so you're sure it recompiled
     
  5. Vengine

    Vengine Previously SkillCode

    no it doesn't return the right version
    [​IMG]
    [​IMG]
     
  6. You have that page cached, try with a different browser. I got 3.0.2.5
     
  7. Vengine

    Vengine Previously SkillCode

    I tried it in a privat tab and it still returns 3.0.2.4
    Maybe CloudFlare cached it
     
  8. [​IMG]
    Your router could also cache web pages, try from the smartphone while not connected to the wifi
     
    • Useful Useful x 2
  9. Vengine

    Vengine Previously SkillCode

    Thank you! That really was my rooter
     
Thread Status:
Not open for further replies.