Skip to content

Commit

Permalink
hiding the empty material and production
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Jun 4, 2024
1 parent 35aaae4 commit 8b540dd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
33 changes: 24 additions & 9 deletions lib/src/multicraft/TmiRecipeEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,39 @@ public Seq<tmi.recipe.Recipe> parse(@NotNull MultiCrafter crafter) {
.setBlock(getWrap(crafter))
.setTime(recipe.craftTime);
for (ItemStack stack : recipe.input.items) {
tmiRecipe.addMaterial(getWrap(stack.item), stack.amount);
if (stack.amount > 0) {
tmiRecipe.addMaterial(getWrap(stack.item), stack.amount);
}
}
for (LiquidStack stack : recipe.input.fluids) {
tmiRecipe.addMaterial(getWrap(stack.liquid), stack.amount);
if (stack.amount > 0) {
tmiRecipe.addMaterial(getWrap(stack.liquid), stack.amount).setPersecFormat();
}
}
if (recipe.input.heat > 0) {
tmiRecipe.addMaterial(HeatMark.INSTANCE, recipe.input.heat);
}
if (recipe.input.power > 0) {
tmiRecipe.addMaterial(PowerMark.INSTANCE, recipe.input.power).setPersecFormat();
}
tmiRecipe.addMaterial(HeatMark.INSTANCE, recipe.input.heat);
tmiRecipe.addMaterial(PowerMark.INSTANCE, recipe.input.power);

// output
for (ItemStack stack : recipe.output.items) {
tmiRecipe.addProduction(getWrap(stack.item), stack.amount);
if (stack.amount > 0) {
tmiRecipe.addProduction(getWrap(stack.item), stack.amount);
}
}
for (LiquidStack stack : recipe.output.fluids) {
tmiRecipe.addProduction(getWrap(stack.liquid), stack.amount);
if (stack.amount > 0) {
tmiRecipe.addProduction(getWrap(stack.liquid), stack.amount).setPersecFormat();
}
}

tmiRecipe.addProduction(HeatMark.INSTANCE, recipe.output.heat);
tmiRecipe.addProduction(PowerMark.INSTANCE, recipe.output.power);
if (recipe.output.heat > 0) {
tmiRecipe.addProduction(HeatMark.INSTANCE, recipe.output.heat);
}
if (recipe.output.heat > 0) {
tmiRecipe.addProduction(PowerMark.INSTANCE, recipe.output.power).setPersecFormat();
}
result.add(tmiRecipe);
}

Expand Down
2 changes: 1 addition & 1 deletion main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mindustry {
mods {
worksWith {
add fromTask ":js:jar"
add java "3Snake3/Sapphirium"
// add java "3Snake3/Sapphirium"
add java "EB-wilson/TooManyItems"
// add local "$buildDir/sapphirium-erekir.zip"
// add local "$buildDir/units-mod.zip"
Expand Down

0 comments on commit 8b540dd

Please sign in to comment.