Skip to content

Commit

Permalink
fix: remove error type that might not mean anything important
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu committed Jun 9, 2024
1 parent c0149d6 commit a7d798c
Showing 1 changed file with 21 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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 -> {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand All @@ -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()) {
Expand All @@ -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;
}
}
}
Expand Down

0 comments on commit a7d798c

Please sign in to comment.