Skip to content

Commit

Permalink
Merge pull request #64 from TacoMonkey11/patch-1
Browse files Browse the repository at this point in the history
fix crash when not hovering over a slot while trying to use wikilookup
  • Loading branch information
LifeIsAParadox authored Apr 6, 2022
2 parents 30fed24 + 0fda7a8 commit 481ea9b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ private void init(CallbackInfo ci) {

@Inject(at = @At("HEAD"), method = "keyPressed", cancellable = true)
public void keyPressed(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable<Boolean> cir) {
if (keyCode != 256 && !MinecraftClient.getInstance().options.inventoryKey.matchesKey(keyCode, scanCode)){
if (WikiLookup.wikiLookup.matchesKey(keyCode, scanCode)) WikiLookup.openWiki(focusedSlot);
if (focusedSlot != null){
if (keyCode != 256 && !MinecraftClient.getInstance().options.inventoryKey.matchesKey(keyCode, scanCode)){
if (WikiLookup.wikiLookup.matchesKey(keyCode, scanCode)) WikiLookup.openWiki(focusedSlot);
}
}
}

Expand Down

0 comments on commit 481ea9b

Please sign in to comment.