Skip to content

Commit

Permalink
Potential fix for crash that happens when breaking a stuck quantum co…
Browse files Browse the repository at this point in the history
…mputer
  • Loading branch information
pedroksl committed Sep 13, 2024
1 parent 95178e1 commit 0b5bbed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ public AAEAbstractCraftingUnitBlock<?> getUnitBlock() {
if (this.level == null || this.notLoaded() || this.isRemoved()) {
return AAEBlocks.QUANTUM_UNIT.block();
}
return (AAEAbstractCraftingUnitBlock<?>)
this.level.getBlockState(this.worldPosition).getBlock();
var block = this.level.getBlockState(this.worldPosition).getBlock();
return block instanceof AAEAbstractCraftingUnitBlock
? (AAEAbstractCraftingUnitBlock<?>) block
: AAEBlocks.QUANTUM_UNIT.block();
}

public long getStorageBytes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public static EmiIngredient stackOf(IngredientStack.Fluid stack) {
List<EmiIngredient> list = new ArrayList<>();
FluidStack[] stacks = ingredient.getStacks();
for (FluidStack fluid : stacks) {
list.add(EmiStack.of(fluid.getFluid(), stack.getAmount()));
}
list.add(EmiStack.of(fluid.getFluid(), stack.getAmount()));
}

return EmiIngredient.of(list, stack.getAmount());
}
Expand Down

0 comments on commit 0b5bbed

Please sign in to comment.