From b0d6ce5b74199328b19a98d363ce5affd2b70151 Mon Sep 17 00:00:00 2001 From: 90 Date: Tue, 19 Nov 2024 16:10:06 +0000 Subject: [PATCH] Fix a crash when attempting to place a fresh bulk cell in a cell workbench --- .../client/screen/PortableCellWorkbenchScreen.java | 6 +++--- .../megacells/mixin/client/CellWorkbenchScreenMixin.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/gripe/_90/megacells/client/screen/PortableCellWorkbenchScreen.java b/src/main/java/gripe/_90/megacells/client/screen/PortableCellWorkbenchScreen.java index f5c0de27..fd7347cc 100644 --- a/src/main/java/gripe/_90/megacells/client/screen/PortableCellWorkbenchScreen.java +++ b/src/main/java/gripe/_90/megacells/client/screen/PortableCellWorkbenchScreen.java @@ -63,9 +63,9 @@ protected void updateBeforeRender() { fuzzyMode.setVisibility(menu.getUpgrades().isInstalled(AEItems.FUZZY_CARD)); if (BulkCellItem.HANDLER.getCellInventory(menu.getHost().mega$getContainedStack(), null) - instanceof BulkCellInventory bulkCell) { - compressionCutoff.setVisibility(bulkCell.isCompressionEnabled() - && !bulkCell.getCompressionChain().isEmpty()); + instanceof BulkCellInventory bulkCell + && !bulkCell.getCompressionChain().isEmpty()) { + compressionCutoff.setVisibility(bulkCell.isCompressionEnabled()); compressionCutoff.setItem(bulkCell.getCompressionChain().get(bulkCell.getCompressionCutoff() - 1)); } else { compressionCutoff.setVisibility(false); diff --git a/src/main/java/gripe/_90/megacells/mixin/client/CellWorkbenchScreenMixin.java b/src/main/java/gripe/_90/megacells/mixin/client/CellWorkbenchScreenMixin.java index dee8e3b5..05de317e 100644 --- a/src/main/java/gripe/_90/megacells/mixin/client/CellWorkbenchScreenMixin.java +++ b/src/main/java/gripe/_90/megacells/mixin/client/CellWorkbenchScreenMixin.java @@ -40,9 +40,9 @@ private void initCutoffButton( @Inject(method = "updateBeforeRender", at = @At("RETURN")) private void updateCutoffButton(CallbackInfo ci) { if (BulkCellItem.HANDLER.getCellInventory(((CellWorkbenchHost) menu.getHost()).mega$getContainedStack(), null) - instanceof BulkCellInventory bulkCell) { - mega$compressionCutoff.setVisibility(bulkCell.isCompressionEnabled() - && !bulkCell.getCompressionChain().isEmpty()); + instanceof BulkCellInventory bulkCell + && !bulkCell.getCompressionChain().isEmpty()) { + mega$compressionCutoff.setVisibility(bulkCell.isCompressionEnabled()); mega$compressionCutoff.setItem(bulkCell.getCompressionChain().get(bulkCell.getCompressionCutoff() - 1)); } else { mega$compressionCutoff.setVisibility(false);