diff --git a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java index 3ec29084eae..c35547be6ae 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java +++ b/src/main/java/gregtech/common/metatileentities/multi/MetaTileEntityFissionReactor.java @@ -301,12 +301,12 @@ public void updateFormedValid() { .getExportItems().insertItem(0, OreDictUnifier.get(OrePrefix.fuelRodHotDepleted, fuelImport.getFuel()), true) .isEmpty()) { - // We still need to know if the output is blocked, even if the recipe doesn't start - // yet - canWork = false; - this.lockingState = LockingState.FUEL_CLOGGED; - break; - } + // We still need to know if the output is blocked, even if the recipe doesn't start + // yet + canWork = false; + this.lockingState = LockingState.FUEL_CLOGGED; + break; + } } for (IFuelRodHandler fuelImport : this.getAbilities(MultiblockAbility.IMPORT_FUEL_ROD)) { @@ -482,19 +482,19 @@ public TraceabilityPredicate getImportPredicate() { MultiblockAbility[] allowedAbilities = { MultiblockAbility.IMPORT_COOLANT, MultiblockAbility.IMPORT_FUEL_ROD, MultiblockAbility.CONTROL_ROD_PORT }; return tilePredicate((state, tile) -> { - if (!(tile instanceof IMultiblockAbilityPart && - ArrayUtils.contains(allowedAbilities, ((IMultiblockAbilityPart) tile).getAbility()))) { - return false; - } - if (tile instanceof IFissionReactorHatch hatchPart) { - if (!hatchPart.checkValidity(height - 1)) { - state.setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid")); + if (!(tile instanceof IMultiblockAbilityPart && + ArrayUtils.contains(allowedAbilities, ((IMultiblockAbilityPart) tile).getAbility()))) { + return false; + } + if (tile instanceof IFissionReactorHatch hatchPart) { + if (!hatchPart.checkValidity(height - 1)) { + state.setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid")); + return false; + } + return true; + } return false; - } - return true; - } - return false; - }, + }, () -> Arrays.stream(allowedAbilities) .flatMap(ability -> MultiblockAbility.REGISTRY.get(ability).stream()) .filter(Objects::nonNull).map(tile -> { @@ -570,19 +570,6 @@ public void checkStructurePattern() { reinitializeStructurePattern(); } super.checkStructurePattern(); - /* - * for (IMultiblockPart part : this.getMultiblockParts()) { - * if (part instanceof IFissionReactorHatch hatchPart) { - * if (!hatchPart.checkValidity(height - 1)) { - * this.invalidateStructure(); - * structurePattern.worldState.update(getWorld(), hatchPart.getPos(), null, null, null, air()); - * structurePattern.worldState - * .setError(new PatternStringError("gregtech.multiblock.pattern.error.hatch_invalid")); - * break; - * } - * } - * } - */ } @Override @@ -774,7 +761,6 @@ private void lockAndPrepareReactor() { if (getWorld().getTileEntity(currentPos) instanceof IGregTechTileEntity gtTe) { MetaTileEntity mte = gtTe.getMetaTileEntity(); ReactorComponent component; - boolean foundPort = true; if (mte instanceof ICoolantHandler coolantIn) { Fluid lockedFluid = coolantIn.getLockedObject(); @@ -795,11 +781,10 @@ private void lockAndPrepareReactor() { } } } - } else { - this.unlockAll(); - setLockingState(LockingState.MISSING_COOLANT); - return; } + this.unlockAll(); + setLockingState(LockingState.MISSING_COOLANT); + return; } else if (mte instanceof IFuelRodHandler fuelIn) { ItemStack lockedFuel = fuelIn.getStackHandler().getStackInSlot(0); if (!lockedFuel.isEmpty()) { @@ -821,15 +806,6 @@ private void lockAndPrepareReactor() { } else if (mte instanceof IControlRodPort controlIn) { component = new ControlRod(100000, controlIn.hasModeratorTip(), 1, 800); fissionReactor.addComponent(component, i + radius, j + radius); - continue; - } else { - foundPort = false; - } - if (foundPort) { // This implies that a port was found, but it didn't generate - // a component because of mismatched inputs - this.unlockAll(); - setLockingState(LockingState.INVALID_COMPONENT); - return; } } }