diff options
| author | BuildTools <james.jenour@protonmail.com> | 2021-01-18 23:59:09 +0800 |
|---|---|---|
| committer | BuildTools <james.jenour@protonmail.com> | 2021-01-18 23:59:09 +0800 |
| commit | 3255cfce951367c9303297205f64577ef1eac650 (patch) | |
| tree | f43ceb889dc96aed62b378bdc4f5fe3fd3fd95ac /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | |
| parent | c9cc530adfb39085fe4b0f9a60e0ca6e4bbb8eb9 (diff) | |
| download | notenoughupdates-3255cfce951367c9303297205f64577ef1eac650.tar.gz notenoughupdates-3255cfce951367c9303297205f64577ef1eac650.tar.bz2 notenoughupdates-3255cfce951367c9303297205f64577ef1eac650.zip | |
gravy
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index f5df9305..3e44dbda 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -53,12 +53,11 @@ public class SBInfo { try { JsonObject obj = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(event.message.getUnformattedText(), JsonObject.class); if(obj.has("server")) { - event.setCanceled(true); + if(System.currentTimeMillis() - lastLocRaw < 5000) event.setCanceled(true); if(obj.has("gametype") && obj.has("mode") && obj.has("map")) { locraw = obj; } } - } catch(Exception e) { e.printStackTrace(); } @@ -73,7 +72,8 @@ public class SBInfo { } public void tick() { - if(locraw == null && (System.currentTimeMillis() - lastLocRaw) > 20000) { + if(Minecraft.getMinecraft().theWorld != null && + locraw == null && (System.currentTimeMillis() - lastLocRaw) > 20000) { lastLocRaw = System.currentTimeMillis(); NotEnoughUpdates.INSTANCE.sendChatMessage("/locraw"); } |
