Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,11 @@ public WorkableTieredMachine(BlockEntityCreationInfo info, int tier, boolean ene
new NotifiableItemStackHandler(getRecipeType().getMaxInputs(ItemRecipeCapability.CAP),
Comment thread
jurrejelle marked this conversation as resolved.
Outdated
IO.IN, IO.BOTH));
this.exportItems = attachTrait(
new NotifiableItemStackHandler(getRecipeType().getMaxOutputs(ItemRecipeCapability.CAP),
IO.OUT));
new NotifiableItemStackHandler(getMaxOutputSize(ItemRecipeCapability.CAP), IO.OUT));
this.importFluids = attachTrait(new NotifiableFluidTank(getRecipeType().getMaxInputs(FluidRecipeCapability.CAP),
Comment thread
htmlcsjs marked this conversation as resolved.
Outdated
tankScalingFunction.applyAsInt(getTier()), IO.IN));
this.exportFluids = attachTrait(
new NotifiableFluidTank(getRecipeType().getMaxOutputs(FluidRecipeCapability.CAP),
new NotifiableFluidTank(getMaxOutputSize(FluidRecipeCapability.CAP),
tankScalingFunction.applyAsInt(getTier()), IO.OUT));
this.importComputation = attachTrait(new NotifiableComputationContainer(IO.IN, true));
this.exportComputation = attachTrait(new NotifiableComputationContainer(IO.OUT, false));
Expand Down Expand Up @@ -178,6 +177,13 @@ public void setMuffled(boolean muffled) {
syncDataHolder.markClientSyncFieldDirty("isMuffled");
}

private int getMaxOutputSize(RecipeCapability<?> cap) {
int recipeTypeOutputSize = getRecipeType().getMaxOutputs(cap);
Comment thread
htmlcsjs marked this conversation as resolved.
Outdated
int machineTypeOutputLimit = this.getDefinition().getRecipeOutputLimits().getOrDefault(cap,
recipeTypeOutputSize);
return Math.min(recipeTypeOutputSize, machineTypeOutputLimit);
}

//////////////////////////////////////
// ******** OVERCLOCK *********//
//////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ public SimpleSteamMachine(BlockEntityCreationInfo info, boolean isHighPressure)
super(info, isHighPressure);
this.importItems = attachTrait(
new NotifiableItemStackHandler(getRecipeType().getMaxInputs(ItemRecipeCapability.CAP), IO.IN, IO.BOTH));
int recipeTypeOutputSize = getRecipeType().getMaxOutputs(ItemRecipeCapability.CAP);
Comment thread
htmlcsjs marked this conversation as resolved.
Outdated
int machineTypeOutputLimit = this.getDefinition().getRecipeOutputLimits().getOrDefault(ItemRecipeCapability.CAP,
recipeTypeOutputSize);
this.exportItems = attachTrait(
new NotifiableItemStackHandler(getRecipeType().getMaxOutputs(ItemRecipeCapability.CAP), IO.OUT));
new NotifiableItemStackHandler(Math.min(recipeTypeOutputSize, machineTypeOutputLimit), IO.OUT));

this.exhaustVentTrait = attachTrait(new ExhaustVentMachineTrait());
exhaustVentTrait.setVentingDamageAmount(isHighPressure() ? 12F : 6F);
Expand Down
Loading