Merge pull request #2 from dragonruler1000/DEV
Added Dust Block and Recipe
|
@ -16,6 +16,7 @@ import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import us.minecraftchest2.hdm_mod.block.ModBlocks;
|
||||||
import us.minecraftchest2.hdm_mod.item.ModItems;
|
import us.minecraftchest2.hdm_mod.item.ModItems;
|
||||||
//import us.minecraftchest2.hdm_mod.init.ItemInit;
|
//import us.minecraftchest2.hdm_mod.init.ItemInit;
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ public class Hdm_mod {
|
||||||
IEventBus modEventBus1 = FMLJavaModLoadingContext.get().getModEventBus();
|
IEventBus modEventBus1 = FMLJavaModLoadingContext.get().getModEventBus();
|
||||||
|
|
||||||
ModItems.register(modEventBus1);
|
ModItems.register(modEventBus1);
|
||||||
|
ModBlocks.register(modEventBus1);
|
||||||
|
|
||||||
modEventBus1.addListener(this::setup);
|
modEventBus1.addListener(this::setup);
|
||||||
// Register the enqueueIMC method for modloading
|
// Register the enqueueIMC method for modloading
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package us.minecraftchest2.hdm_mod.block;
|
||||||
|
|
||||||
|
import net.minecraft.block.AbstractBlock;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.item.BlockItem;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
|
import net.minecraftforge.fml.RegistryObject;
|
||||||
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
|
import net.minecraftforge.registries.ForgeRegistries;
|
||||||
|
import us.minecraftchest2.hdm_mod.Hdm_mod;
|
||||||
|
import us.minecraftchest2.hdm_mod.item.ModItems;
|
||||||
|
import us.minecraftchest2.hdm_mod.item.ModItemGroup;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public class ModBlocks {
|
||||||
|
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, Hdm_mod.MOD_ID);
|
||||||
|
|
||||||
|
|
||||||
|
public static final RegistryObject<Block> DUST_BLOCK = registerBlock("block_of_dust",
|
||||||
|
() -> new Block(AbstractBlock.Properties.create(Material.ROCK).doesNotBlockMovement().harvestLevel(0)
|
||||||
|
.hardnessAndResistance(5f)));
|
||||||
|
|
||||||
|
|
||||||
|
private static <T extends Block>RegistryObject<T> registerBlock(String name, Supplier<T> block) {
|
||||||
|
RegistryObject<T> toReturn = BLOCKS.register(name, block);
|
||||||
|
registerBlockItem(name, toReturn);
|
||||||
|
return toReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) {
|
||||||
|
ModItems.ITEMS.register(name, () -> new BlockItem(block.get(),
|
||||||
|
new Item.Properties().group(ModItemGroup.HDM_BLOCK_GROUP)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void register(IEventBus eventBus){
|
||||||
|
BLOCKS.register(eventBus);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package us.minecraftchest2.hdm_mod.item;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemGroup;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import us.minecraftchest2.hdm_mod.block.ModBlocks;
|
||||||
|
|
||||||
|
public class ModItemGroup {
|
||||||
|
public static final ItemGroup HDM_ITEM_GROUP = new ItemGroup("hdmModItemTab") {
|
||||||
|
@Override
|
||||||
|
public ItemStack createIcon()
|
||||||
|
{
|
||||||
|
return new ItemStack(ModItems.DUST.get());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
public static final ItemGroup HDM_BLOCK_GROUP = new ItemGroup("hdmModBlockTab") {
|
||||||
|
@Override
|
||||||
|
public ItemStack createIcon() {
|
||||||
|
return new ItemStack(ModBlocks.DUST_BLOCK.get());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package us.minecraftchest2.hdm_mod.item;
|
package us.minecraftchest2.hdm_mod.item;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemGroup;
|
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
import net.minecraftforge.fml.RegistryObject;
|
import net.minecraftforge.fml.RegistryObject;
|
||||||
import net.minecraftforge.registries.DeferredRegister;
|
import net.minecraftforge.registries.DeferredRegister;
|
||||||
|
@ -14,7 +13,10 @@ public class ModItems {
|
||||||
DeferredRegister.create(ForgeRegistries.ITEMS, Hdm_mod.MOD_ID);
|
DeferredRegister.create(ForgeRegistries.ITEMS, Hdm_mod.MOD_ID);
|
||||||
|
|
||||||
public static final RegistryObject<Item> DUST = ITEMS.register("dust",
|
public static final RegistryObject<Item> DUST = ITEMS.register("dust",
|
||||||
() -> new Item(new Item.Properties().isImmuneToFire().maxStackSize(65).group(ItemGroup.MATERIALS)));
|
() -> new Item(new Item.Properties().isImmuneToFire().maxStackSize(42).group(ModItemGroup.HDM_ITEM_GROUP)));
|
||||||
|
|
||||||
|
// public static final RegistryObject<Item> OMELET = ITEMS.register("omelet",
|
||||||
|
// () -> new Item(new Item.Properties().food()))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {"model": "hdm_mod:blocks/block_of_dust" }
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
{
|
{
|
||||||
"itemGroup.hdm_mod": "HDM Mod Items",
|
"itemGroup.hdmModItemTab": "HDM Mod Items",
|
||||||
|
"itemGroup.hdmModBlockTab": "HDM Mod Blocks",
|
||||||
|
|
||||||
"item.hdm_mod.knife": "Subtle Knife",
|
"item.hdm_mod.knife": "Subtle Knife",
|
||||||
"item.hdm_mod.omelet": "Omelet",
|
"item.hdm_mod.omelet": "Omelet",
|
||||||
"item.hdm_mod.dust": "Dust"
|
"item.hdm_mod.dust": "Dust",
|
||||||
|
"block.hdm_mod.block_of_dust": "Block of Dust"
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "block/cube_all",
|
||||||
|
"textures" : {
|
||||||
|
"all": "hdm_mod:block/block_of_dust"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "hdm_mod:block/block_of_dust"
|
||||||
|
}
|
After Width: | Height: | Size: 307 B |
After Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 108 B |
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 136 B |
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"rolls": 1,
|
||||||
|
"entries":[
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "hdm_mod:dust"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
16
src/main/resources/data/hdm_mod/recipies/block_of_dust.json
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
"###",
|
||||||
|
"###",
|
||||||
|
"###"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"#": {
|
||||||
|
"item": "hdm_mod:dust"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "hdm_mod:block_of_dust"
|
||||||
|
}
|
||||||
|
}
|