Skip to content

Instantly share code, notes, and snippets.

@allxrise
Created August 4, 2020 18:12
Show Gist options
  • Save allxrise/5f17eb60ea1a61e09d81c79989310bb2 to your computer and use it in GitHub Desktop.
Save allxrise/5f17eb60ea1a61e09d81c79989310bb2 to your computer and use it in GitHub Desktop.
package net.allxrise.mod.allxrisemod;
import net.allxrise.mod.allxrisemod.blocks.lucky_block;
import net.allxrise.mod.allxrisemod.blocks.radioactive_block;
import net.allxrise.mod.allxrisemod.items.CreperHearthItem;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
import net.minecraft.block.Blocks;
import net.minecraft.block.Material;
import net.minecraft.item.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.allxrise.mod.allxrisemod.blocks.mercury_block;
public class AllxriseMod implements ModInitializer {
public static final ItemGroup ITEM_GROUP = FabricItemGroupBuilder.create(
new Identifier("allxrisemod","allxrise_mod"))
.icon(() -> new ItemStack(Items.ITEM_FRAME))
.appendItems(stacks -> {
stacks.add(new ItemStack(Blocks.BONE_BLOCK));
stacks.add(new ItemStack(Blocks.ACACIA_BUTTON));
})
.build();
private static final radioactive_block RADIOACTIVE_BLOCK = new radioactive_block(FabricBlockSettings.of(Material.NETHER_WOOD).breakByHand(false));
private static final CreperHearthItem CREEPER_HEART = new CreperHearthItem(new Item.Settings().group(ItemGroup.MATERIALS).maxCount(32));
private static final Item RADIACTIVE_BLOCK_ITEM = new BlockItem(RADIOACTIVE_BLOCK, new Item.Settings().group(AllxriseMod.ITEM_GROUP));
private static final mercury_block MERCURY_BLOCK = new mercury_block(FabricBlockSettings.of(Material.METAL));
private static final Item MERCURY_BLOCK_ITEM = new BlockItem(MERCURY_BLOCK, new Item.Settings().group(AllxriseMod.ITEM_GROUP));
private static final lucky_block LUCKY_BLOCK = new lucky_block(FabricBlockSettings.of(Material.BAMBOO));
private static final Item LUCKY_BLOCK_ITEM = new BlockItem(LUCKY_BLOCK, new Item.Settings().group(AllxriseMod.ITEM_GROUP));
@Override
public void onInitialize() {
Registry.register(Registry.ITEM, new Identifier("allxrisemod","creeper_heart"), CREEPER_HEART);
Registry.register(Registry.BLOCK, new Identifier("allxrisemod","radioactive_block"), RADIOACTIVE_BLOCK);
Registry.register(Registry.ITEM, new Identifier("allxrisemod","radioactive_block"), RADIACTIVE_BLOCK_ITEM);
Registry.register(Registry.BLOCK, new Identifier("allxrisemod","mercury_block"), MERCURY_BLOCK);
Registry.register(Registry.ITEM, new Identifier("allxrisemod","mercury_block"), MERCURY_BLOCK_ITEM);
Registry.register(Registry.BLOCK, new Identifier("allxrisemod","lucky_block"), LUCKY_BLOCK);
Registry.register(Registry.ITEM, new Identifier("allxrisemod", "lucky_block"), LUCKY_BLOCK_ITEM);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment