aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTacoMonkey <75862693+TacoMonkey11@users.noreply.github.com>2022-01-22 18:31:53 -0500
committerTacoMonkey <75862693+TacoMonkey11@users.noreply.github.com>2022-01-25 16:44:30 -0500
commit908f2546046086121c5ef903040e38f6ecbe57ea (patch)
tree822e85a5ca2380eca0edeac1f24cb7eda12e1d15
parentca6ed04a8aa6880ff339d0b6557940ff638cff4c (diff)
downloadSkyblocker-908f2546046086121c5ef903040e38f6ecbe57ea.tar.gz
Skyblocker-908f2546046086121c5ef903040e38f6ecbe57ea.tar.bz2
Skyblocker-908f2546046086121c5ef903040e38f6ecbe57ea.zip
Squashed a bug and changed default hey to something less stupid
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/item/WikiLookup.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/WikiLookup.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/WikiLookup.java
index ea2faeb4..30da694e 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/WikiLookup.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/item/WikiLookup.java
@@ -10,6 +10,7 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
+import net.minecraft.text.Text;
import net.minecraft.util.Util;
import org.lwjgl.glfw.GLFW;
@@ -28,7 +29,7 @@ public class WikiLookup {
public static void init(){
wikiLookup = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.wikiLookup",
- GLFW.GLFW_KEY_Y,
+ GLFW.GLFW_KEY_F4,
"key.categories.skyblocker"
));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
@@ -47,8 +48,9 @@ public class WikiLookup {
JsonObject rootobj = root.getAsJsonObject();
String wikiLink = rootobj.get("info").getAsString();
Util.getOperatingSystem().open(wikiLink);
- } catch (IOException e) {
+ } catch (IOException | NullPointerException e) {
e.printStackTrace();
+ client.player.sendMessage(Text.of("Can't locate a wiki article for this item..."), false);
}
}
@@ -58,8 +60,8 @@ public class WikiLookup {
public static String getSkyblockId() {
//Grabbing the skyblock NBT data
- ItemStack mainHandStack = client.player.getMainHandStack();
- NbtCompound nbt = mainHandStack.getSubNbt("ExtraAttributes");
+ ItemStack mainStack = client.player.getMainHandStack();
+ NbtCompound nbt = mainStack.getSubNbt("ExtraAttributes");
if (nbt != null) {
id = nbt.getString("id");
}