Item & Block registry

This commit is contained in:
paulevsGitch 2020-09-23 16:23:34 +03:00
parent 89ddb7cf33
commit ebbb10d972
6 changed files with 110 additions and 1 deletions

View file

@ -0,0 +1,28 @@
package ru.betterend.registry;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd;
import ru.betterend.blocks.BlockWetMycelium;
import ru.betterend.tab.CreativeTab;
public class BlockRegistry {
public static final Block WET_MYCELIUM = registerBlock("wet_mycelium", new BlockWetMycelium());
public static void register() {}
private static Block registerBlock(String name, Block block)
{
Registry.register(Registry.BLOCK, new Identifier(BetterEnd.MOD_ID, name), block);
ItemRegistry.registerItem(name, new BlockItem(block, new Item.Settings().group(CreativeTab.END_TAB)));
return block;
}
public static Block registerBlockNI(String name, Block block)
{
return Registry.register(Registry.BLOCK, new Identifier(BetterEnd.MOD_ID, name), block);
}
}