Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 authored and arlomcwalter committed Jan 28, 2023
1 parent 62b5880 commit 90fb81a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public HandledScreenMixin(Text title) {
private void onInit(CallbackInfo info) {
InventoryTweaks invTweaks = Modules.get().get(InventoryTweaks.class);

if (invTweaks.canSteal(getScreenHandler())&& invTweaks.isActive() && invTweaks.showButtons()) {
if (invTweaks.isActive() && invTweaks.showButtons() && invTweaks.canSteal(getScreenHandler())) {
addDrawableChild(
new ButtonWidget.Builder(Text.literal("Steal"), button -> invTweaks.steal(getScreenHandler()))
.position(width / 2 - 40, 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public boolean armorSwap() {
public boolean canSteal(ScreenHandler handler) {
try {
return (stealScreens.get().contains(handler.getType()));
} catch (UnsupportedClassVersionError e) {
} catch (UnsupportedOperationException e) {
return false;
}
}
Expand Down

0 comments on commit 90fb81a

Please sign in to comment.