aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-01-18 23:59:09 +0800
committerBuildTools <james.jenour@protonmail.com>2021-01-18 23:59:09 +0800
commit3255cfce951367c9303297205f64577ef1eac650 (patch)
treef43ceb889dc96aed62b378bdc4f5fe3fd3fd95ac /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
parentc9cc530adfb39085fe4b0f9a60e0ca6e4bbb8eb9 (diff)
downloadnotenoughupdates-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.java6
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");
}