Created
June 11, 2020 16:35
-
-
Save HexBugOrion/424eb651985ac01f2e130d5fc98030c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.oriondev.discovery_core; | |
import net.fabricmc.api.ModInitializer; | |
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; | |
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; | |
import net.minecraft.block.AbstractGlassBlock; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.BlockState; | |
import net.minecraft.block.Material; | |
import net.minecraft.client.render.RenderLayer; | |
import net.minecraft.item.BlockItem; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemGroup; | |
import net.minecraft.sound.BlockSoundGroup; | |
import net.minecraft.util.Identifier; | |
import net.minecraft.util.math.BlockPos; | |
import net.minecraft.util.registry.Registry; | |
import net.minecraft.world.BlockView; | |
public class DiscoveryCore implements ModInitializer { | |
//Items | |
public static final Item IRON_ORE_CHUNK = new Item(new Item.Settings().group(ItemGroup.MISC)); | |
public static final Item GOLD_ORE_CHUNK = new Item(new Item.Settings().group(ItemGroup.MISC)); | |
//Blocks | |
public static final Block OBSIDIAN_TILE = new Block(FabricBlockSettings.of(Material.STONE).hardness(50).resistance(1200).sounds(BlockSoundGroup.STONE)); | |
public static final Block BLAST_GLASS = new AbstractGlassBlock(FabricBlockSettings.of(Material.GLASS).hardness(50).resistance(1200).nonOpaque().sounds(BlockSoundGroup.GLASS)) { | |
@Override | |
public float getAmbientOcclusionLightLevel(BlockState state, BlockView view, BlockPos pos) { | |
return super.getAmbientOcclusionLightLevel(state, view, pos); | |
} | |
}; | |
@Override | |
public void onInitialize() { | |
//Items | |
Registry.register(Registry.ITEM, new Identifier("discovery_core", "iron_ore_chunk"), IRON_ORE_CHUNK); | |
Registry.register(Registry.ITEM, new Identifier("discovery_core", "gold_ore_chunk"), GOLD_ORE_CHUNK); | |
//Blocks and BlockItems | |
Registry.register(Registry.BLOCK, new Identifier("discovery_core", "blast_glass"), BLAST_GLASS); | |
Registry.register(Registry.ITEM, new Identifier("discovery_core", "blast_glass"), new BlockItem(BLAST_GLASS, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS))); | |
Registry.register(Registry.ITEM, new Identifier("discovery_core", "obsidian_tile"), new BlockItem(OBSIDIAN_TILE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS))); | |
BlockRenderLayerMap.INSTANCE.putBlock(BLAST_GLASS, RenderLayer.getTranslucent()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment