mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Update usage of WebUtils
This commit is contained in:
parent
528de86340
commit
8d24891c97
1 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
package org.geysermc.geyser.command.defaults;
|
package org.geysermc.geyser.command.defaults;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.google.gson.JsonObject;
|
||||||
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
|
||||||
import org.geysermc.geyser.GeyserImpl;
|
import org.geysermc.geyser.GeyserImpl;
|
||||||
import org.geysermc.geyser.api.util.PlatformType;
|
import org.geysermc.geyser.api.util.PlatformType;
|
||||||
|
@ -86,8 +86,8 @@ public class VersionCommand extends GeyserCommand {
|
||||||
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.checking", sender.locale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.checking", sender.locale()));
|
||||||
try {
|
try {
|
||||||
int buildNumber = this.geyser.buildNumber();
|
int buildNumber = this.geyser.buildNumber();
|
||||||
JsonNode response = WebUtils.getJson("https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest");
|
JsonObject response = WebUtils.getJson("https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest");
|
||||||
int latestBuildNumber = response.get("build").asInt();
|
int latestBuildNumber = response.get("build").getAsInt();
|
||||||
|
|
||||||
if (latestBuildNumber == buildNumber) {
|
if (latestBuildNumber == buildNumber) {
|
||||||
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.no_updates", sender.locale()));
|
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.no_updates", sender.locale()));
|
||||||
|
|
Loading…
Reference in a new issue