Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.caching=true
kotlin.code.style=official

mc_version=1.21.1
neoforge_version=21.1.152
neoforge_version=21.1.213
java_version=21

mod_id=sliceanddice
Expand All @@ -16,9 +16,9 @@ maven_group=com.possible-triangle

jei_version=19.21.0.247
flywheel_version=1.0.2
create_version=6.0.6-99
ponder_version=1.0.56
registrate_version=MC1.21-1.3.0+62
create_version=6.0.7-159
ponder_version=1.0.63
registrate_version=MC1.21-1.3.0+67
kotlin_forge_version=5.8.0

farmers_delight_version=opCbq7uB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ class SlicerBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state: BlockSta
addToParticleItems(input.stack)

val toProcess = if (canProcessInBulk()) input.stack else input.stack.copyWithCount(1)
val outputs = RecipeApplier.applyRecipeOn(level, toProcess, recipe)
val world = level ?: return false
val outputs = RecipeApplier.applyRecipeOn(world, toProcess, recipe, true)
outputList?.addAll(outputs)
consumeDurability()
return true
Expand Down Expand Up @@ -335,4 +336,4 @@ class SlicerBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state: BlockSta
)
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import com.possible_triangle.sliceanddice.config.Configs
import com.simibubi.create.content.fluids.transfer.EmptyingRecipe
import com.simibubi.create.content.kinetics.mixer.MixingRecipe
import com.simibubi.create.content.processing.recipe.StandardProcessingRecipe
import com.simibubi.create.foundation.fluid.FluidIngredient
import net.minecraft.resources.ResourceLocation
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.material.FlowingFluid
import net.neoforged.neoforge.capabilities.Capabilities
import net.neoforged.neoforge.fluids.FluidStack
import net.neoforged.neoforge.fluids.capability.IFluidHandler
Expand All @@ -29,6 +29,7 @@ class MixingRecipeGenerator(private val emptyingRecipes: Collection<EmptyingReci
private fun getFromFluidHandler(stack: ItemStack): FluidStack? =
stack.getCapability(Capabilities.FluidHandler.ITEM)
?.drain(1000, IFluidHandler.FluidAction.SIMULATE)
?.takeUnless { it.isEmpty }

private fun resolveIngredient(stack: ItemStack): Either<FluidStack, ItemStack> {
val fluid = getFromEmptying(stack) ?: getFromFluidHandler(stack)
Expand Down Expand Up @@ -113,14 +114,20 @@ data class Ingredients(val items: List<Ingredient>, val fluids: List<FluidStack>
}

fun createRecipe(id: ResourceLocation, cookTime: Int, output: ItemStack): MixingRecipe {
val fluidIngredients = fluids.map { FluidIngredient.fromFluidStack(it) }
return StandardProcessingRecipe.Builder(::MixingRecipe, id)
val builder = StandardProcessingRecipe.Builder(::MixingRecipe, id)
.withItemIngredients(*items.toTypedArray())
.withFluidIngredients(*fluidIngredients.toTypedArray())
.requiresHeat(Configs.SERVER.COOKING_HEAT_CONDITION.get())
.duration(cookTime)
.withSingleItemOutput(output)
.build()

fluids.forEach { fluidStack ->
val fluid = fluidStack.fluid
if (fluid is FlowingFluid) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the check for flowing fluid? Because it would recognize still/flowing water as separate things?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the check if (fluid is FlowingFluid) is there because the still and flowing variants are separate fluid types, so only handling the flowing variant avoids treating 'still water' and 'flowing water' as distinct recipe ingredients.

Atleast thats what i understood from the docs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's specifically what crashed me personally, something broke there and it said something about flowing fluid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you send me the full log? In my end the game launched normally, without errors and i was able to play it without any issue.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant, i use curseforge, so i wouldn't know to remove it once the mod updates.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can wait, i'll just backport create again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant, i use curseforge, so i wouldn't know to remove it once the mod updates.

Enter to your modpack > 3 dots > Open folder > find the folder that is called "mods" > find the create slice and dice jar file. delete and replace with the temporary fix jar when i send it. Curseforge will recognise it but say its "modified" because its not installed by curseforge itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exact name of mod should be sliceanddice-forge-4.1.2.jar or sliceanddice-forge-4.1.2.jar.disabled

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can just keep create unupdated until slice and dice updates.

builder.require(fluid, fluidStack.amount)
}
}

return builder.build()
}

}
}