-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ New UpdateChecker 🛠Fix command reload can't refresh new hologram
- Loading branch information
Showing
14 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/github/l1an/yuspawnerhologram/api/UpdateChecker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.github.l1an.yuspawnerhologram.api | ||
|
||
import taboolib.common.platform.function.info | ||
import taboolib.common.platform.function.submit | ||
import java.io.IOException | ||
import java.net.URL | ||
import java.util.* | ||
import java.util.function.Consumer | ||
|
||
class UpdateChecker(private val resourceId: Int) { | ||
fun getVersion(consumer: Consumer<String?>) { | ||
submit(async = true) { | ||
try { | ||
URL("https://api.spigotmc.org/legacy/update.php?resource=" + resourceId + "/~") | ||
.openStream().use { `is` -> | ||
Scanner(`is`).use { scann -> | ||
if (scann.hasNext()) { | ||
consumer.accept(scann.next()) | ||
} | ||
} | ||
} | ||
} catch (e: IOException) { | ||
info("Unable to check for updates: " + e.message) | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file added
BIN
+6 KB
src/main/kotlin/com/github/l1an/yuspawnerhologram/internal/core/.DS_Store
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters