How to make a reverse recipe from block/brick?

Started by Termont on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a reverse recipe from block/brick?

How to make a reverse recipe from block/brick?
For example: Copper Ingot x9 -> Copper Block
Reverse: Copper Block -> Copper Ingot x9 .
Like iron block.

Joined Mar 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create new recipe, check for
Sat, 05/06/2017 - 18:50

Create new recipe, check for "Is recipe shapeless", put your blocks and output slot ingot and change amount to 9

Joined Sep 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:Create new recipe, check for
Sat, 05/06/2017 - 19:44

@#1

@CAHEKa Спасибо :)
Сейчас чуть в коде нового рецепта полазил, части копировал, вставлял, проверял и в итоге нашел часть, который обратный крафт делает. Ибо делать новый элемент для каждого блока, все таки не особо хочется делать.
 

Если что, часть выделена жирным шрифтом | If you want to make reverse craft without make new element of your mod, you can add part of code(Allocated bold) and put in code of block/item and the others.
 

 

[spoiler]public void load(FMLInitializationEvent event) {               if (event.getSide() == Side.CLIENT) {                    Minecraft.getMinecraft().getRenderItem().getItemModelMesher()                                    .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("testenvironmentmod:copperblock", "inventory"));         }              GameRegistry.addRecipe(new ItemStack(block, 1), new Object[]{"012", "345", "678", Character.valueOf('0'), mcreator_copperIngot.block,                 Character.valueOf('1'), mcreator_copperIngot.block, Character.valueOf('2'), mcreator_copperIngot.block, Character.valueOf('3'),                 mcreator_copperIngot.block, Character.valueOf('4'), mcreator_copperIngot.block, Character.valueOf('5'), mcreator_copperIngot.block,                 Character.valueOf('6'), mcreator_copperIngot.block, Character.valueOf('7'), mcreator_copperIngot.block, Character.valueOf('8'),                 mcreator_copperIngot.block,});      ItemStack recStack = new ItemStack(mcreator_copperIngot.block, 9);                       GameRegistry.addShapelessRecipe(recStack, new Object[]{mcreator_copperBlock.block,});   [/spoiler]