Future MC

Future MC

14M Downloads

[1.12.2] [Enhancement] Make modded blocks supported by the stonecutter without CraftTweaker

yezhiyi9670 opened this issue ยท 2 comments

commented

I see that the recipes of the stonecutter is already different from vanilla. Why not implement a strategy to recorgnize supported blocks?

I came up with an idea.

Definitions

Note: The word 'recipe' in the definitions means crafting table recipes.

A full block is a block which has full model, does block face culling and causes mobs to suffocate.

A stone-like block is a full block which has stone material. Non stone-like blocks should not be supported by the stonecutter.

A slab recipe is a recipe with pattern [[III]], where I represents a kind of full block, and produces 6 blocks with the same block material as the input.

A stair recipe is a recipe with pattern [[I ][II ][III]], where I represents a kind of full block, and produces 4 or 8 blocks with the same block material as the input.

A polishing recipe is a recipe with pattern [[II][II]], where I represents a kind of full block, and produces 4 full blocks with the same block material as the input.

A wall recipe is a recipe with pattern [[III][III]], where I represents a kind of full block, and produces 6 blocks with the same block material as the input.

A slab is a block produced by a slab recipe.

A chiseling recipe is a recipe with pattern [[I][I]], where I represents a kind of slab, and produces 1 full block with the same material as the input.

Having a X recipe means the block can be the input of a X recipe.

The X form of Y is the result of a X recipe which takes Y as the input.

The chiseled form of Y means The chiseled form of {the slab form of Y}, if Y is a full block.

The Method

The less production list of a stone-like block is produced as below:

  • Add 2 slab forms of the block to the list if exists.
  • Add 1 stair form of the block to the list if exists.
  • Add 1 wall form of the block to the list if exists.
  • Add 1 chiseled form of the block to the list if exists.
  • Add 1 polished form of the block to the list if exists.
  • Deduplicate the list.

The recipe manager should look through all stone-like blocks and produce a production list of each:

  • Add all things in the block's less production list to the list.
  • Add all things in the {chiseled form of the block}'s less production list to the list if the chiseled form exists.
  • Add all things in the {polished form of the block}'s less production list to the list if the polished form exists.
  • Add all things in the {chiseled form of the {polished form of the block}}'s less production list to the list if that form exists.
  • Deduplicate the list

Foreach stone-like block X:

  • Foreach Y in the production list of X: Add a stonecutter recipe X -> Y

P.S. I'll try to implement it with CraftTweaker.

Note: The stonecutter should not produce 2 stairs if the original stair recipe produces 8 because a stair-to-block recipe is usually added for these stair recipes and producing 2 in the stonecutter can lead to exploits.

commented

How do you suggest I go about detecting chiseled/polished variants?

commented

I think using the definition of chiseled recipe and polished recipe is ok because stone is expected to produce stonebricks in the stonecutter. It's a little tricky, so it may need a blacklist config option.