New blocks and items
This commit is contained in:
parent
1966d89dc7
commit
98b714827a
20 changed files with 191 additions and 3 deletions
34
src/main/java/ru/betterend/recipe/CraftingRecipes.java
Normal file
34
src/main/java/ru/betterend/recipe/CraftingRecipes.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package ru.betterend.recipe;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
|
||||
public class CraftingRecipes {
|
||||
public static void register() {
|
||||
if (blockExists(BlockRegistry.ENDER_BLOCK)) {
|
||||
new RecipeBuilder("be_ender_pearl_to_block", BlockRegistry.ENDER_BLOCK)
|
||||
.setShape(new String[] { "OO", "OO" })
|
||||
.addMaterial('O', Items.ENDER_PEARL)
|
||||
.build();
|
||||
new RecipeBuilder("be_ender_block_to_pearl", Items.ENDER_PEARL)
|
||||
.addMaterial('#', BlockRegistry.ENDER_BLOCK)
|
||||
.setOutputCount(4)
|
||||
.setList("#")
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean itemExists(Item item)
|
||||
{
|
||||
return Registry.ITEM.getId(item) != Registry.ITEM.getDefaultId();
|
||||
}
|
||||
|
||||
private static boolean blockExists(Block block)
|
||||
{
|
||||
return Registry.BLOCK.getId(block) != Registry.BLOCK.getDefaultId();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue