Farmer's Delight

Farmer's Delight

97M Downloads

Could you please set a parameter of INVENTORY_SLOT_COUNT?

Goulixiaoji opened this issue · 6 comments

commented

public StoveBlockEntity(BlockPos pos, BlockState state) {

commented

Hi there! What's the use case for this parameter? Are you making an add-on with custom stoves?

commented

Yes, I am making an add-on mod called Twilight Delight, I need a stove with 8 troughs

commented

Ah, I see! Hmm... to be honest, I think you might have an easier time just copying the code, or at least extending and overriding most methods in StoveBlockEntity.

The Stove isn't designed to easily change the inventory slot count, because much of its rendering logic depends on it being 6 (item positions and matrices, for example). It doesn't have many utilities to accomodate extra items due to its distinct nature. In fact, much of its code is adapted from the Campfire without directly extending it, since their food-cooking functions are designed to be similar.

Also, since I haven't written a proper API for FD, depending on this class will likely break your add-on frequently during minor updates. I'll see about it, but for now, feel free to copy any part of the Stove's code to fit your needs!

I'm closing this as it's not an issue, but rather a suggestion. But feel free to reply if you want! 👍

commented

Moreover, is there a public method to get the cutting recipe?
I only found this:

private Optional<CuttingBoardRecipe> getMatchingRecipe(RecipeWrapper recipeWrapper, ItemStack toolStack, @Nullable Player player) {

so I use it like that

commented

Recipe checking can be done directly into Minecraft's recipe manager; you don't have to refer to this method directly.

getMatchingRecipe is a method which does a caching routine when consulting recipes, so that using the Cutting Board doesn't cause repetitive queries. The relevant bit for finding cutting recipes is this:

List<CuttingBoardRecipe> recipeList = level.getRecipeManager().getRecipesFor(ModRecipeTypes.CUTTING.get(), recipeWrapper, level);

If you have an external block or item trying to operate a Cutting Board, you can call processStoredItemUsingTool, or mimic a fake player's right-click.

commented

Ok, thank you!