diff --git a/src/main/java/com/jingy/jineric/Jineric.java b/src/main/java/com/jingy/jineric/Jineric.java index 9d357e36..a931a2fb 100644 --- a/src/main/java/com/jingy/jineric/Jineric.java +++ b/src/main/java/com/jingy/jineric/Jineric.java @@ -1,7 +1,7 @@ package com.jingy.jineric; -import com.jingy.jineric.registry.ModBlocks; -import com.jingy.jineric.registry.ModItems; +import com.jingy.jineric.registry.Blocks; +import com.jingy.jineric.registry.Items; import net.fabricmc.api.ModInitializer; public class Jineric implements ModInitializer { @@ -10,7 +10,7 @@ public class Jineric implements ModInitializer { @Override public void onInitialize() { - ModItems.registerItems(); - ModBlocks.registerBlocks(); + Items.registerItems(); + Blocks.registerBlocks(); } } \ No newline at end of file diff --git a/src/main/java/com/jingy/jineric/registry/BlockSettings.java b/src/main/java/com/jingy/jineric/registry/BlockSettings.java new file mode 100644 index 00000000..6d7f1495 --- /dev/null +++ b/src/main/java/com/jingy/jineric/registry/BlockSettings.java @@ -0,0 +1,29 @@ +package com.jingy.jineric.registry; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.minecraft.block.Block; +import net.minecraft.block.Material; +import net.minecraft.sound.BlockSoundGroup; + +public class BlockSettings { + + public static Block StoneSettings() { + return new Block(FabricBlockSettings + .of(Material.STONE) + .breakByTool(FabricToolTags.PICKAXES, 0) + .requiresTool() + .strength(1.5f, 30.0f) + .sounds(BlockSoundGroup.STONE)); + } + + public static Block SandstoneSettings() { + return new Block(FabricBlockSettings + .of(Material.STONE) + .breakByTool(FabricToolTags.PICKAXES, 0) + .requiresTool() + .strength(0.8f, 4f) + .sounds(BlockSoundGroup.SOUL_SAND)); + } + +} diff --git a/src/main/java/com/jingy/jineric/registry/Blocks.java b/src/main/java/com/jingy/jineric/registry/Blocks.java new file mode 100644 index 00000000..635f6d93 --- /dev/null +++ b/src/main/java/com/jingy/jineric/registry/Blocks.java @@ -0,0 +1,49 @@ +package com.jingy.jineric.registry; + +import com.jingy.jineric.Jineric; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; +import net.minecraft.block.Block; +import net.minecraft.block.Material; +import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; + +public class Blocks { + + //STONE BLOCKS: + public static final Block CORRITE = BlockSettings.StoneSettings(); + public static final Block BORITE = BlockSettings.StoneSettings(); + + //SAND BLOCKS: + public static final Block WAVY_SANDSTONE = BlockSettings.SandstoneSettings(); + + //SOUL SAND BLOCKS: + + public static final Block SOUL_SANDSTONE = BlockSettings.SandstoneSettings(); + public static final Block CUT_SOUL_SANDSTONE = BlockSettings.SandstoneSettings(); + public static final Block CHISELED_SOUL_SANDSTONE = BlockSettings.SandstoneSettings(); + public static final Block WAVY_SOUL_SANDSTONE = BlockSettings.SandstoneSettings(); + public static final Block SMOOTH_SOUL_SANDSTONE = BlockSettings.SandstoneSettings(); + + public static void registerBlocks() { + +//STONES: + + //Corrite: + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "corrite"), CORRITE); + + //Borite: + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "borite"), BORITE); + + //SANDSTONES: + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "wavy_sandstone"), WAVY_SANDSTONE); + + //SOUL SANDSTONE: + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "cut_soul_sandstone"), CUT_SOUL_SANDSTONE); + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "chiseled_soul_sandstone"), CHISELED_SOUL_SANDSTONE); + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "wavy_soul_sandstone"), WAVY_SOUL_SANDSTONE); + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "smooth_soul_sandstone"), SMOOTH_SOUL_SANDSTONE); + Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "soul_sandstone"), SOUL_SANDSTONE); + } +} \ No newline at end of file diff --git a/src/main/java/com/jingy/jineric/registry/ItemSettings.java b/src/main/java/com/jingy/jineric/registry/ItemSettings.java new file mode 100644 index 00000000..e7973b81 --- /dev/null +++ b/src/main/java/com/jingy/jineric/registry/ItemSettings.java @@ -0,0 +1,17 @@ +package com.jingy.jineric.registry; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; + +public class ItemSettings { + public static Item.Settings BuildingBlocks() { + return new Item.Settings().group(ItemGroup.BUILDING_BLOCKS); + } + + public static Item.Settings Misc() { + return new Item.Settings().group(ItemGroup.MISC); + } + public static Item.Settings Decoration() { + return new Item.Settings().group(ItemGroup.DECORATIONS); + } +} diff --git a/src/main/java/com/jingy/jineric/registry/ModItems.java b/src/main/java/com/jingy/jineric/registry/Items.java similarity index 73% rename from src/main/java/com/jingy/jineric/registry/ModItems.java rename to src/main/java/com/jingy/jineric/registry/Items.java index 1fb6e97c..2c41481f 100644 --- a/src/main/java/com/jingy/jineric/registry/ModItems.java +++ b/src/main/java/com/jingy/jineric/registry/Items.java @@ -1,52 +1,52 @@ -package com.jingy.jineric.registry; - -import com.jingy.jineric.Jineric; -import net.minecraft.item.BlockItem; -import net.minecraft.item.FoodComponent; -import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; - -public class ModItems { - -//ITEMS: - - //FOODS: - public static final Item GOLDEN_POTATO = new Item( - new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder().hunger(6).saturationModifier(14.4f).build())); - - public static final Item GOLDEN_SWEET_BERRIES = new Item( - new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder().hunger(5).saturationModifier(8f).build())); - - public static final Item GOLDEN_BEETROOT = new Item( - new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder().hunger(4).saturationModifier(5f).build())); - -//BLOCK ITEMS: - public static final BlockItem CORRITE = new BlockItem(ModBlocks.CORRITE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem BORITE = new BlockItem(ModBlocks.BORITE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem WAVY_SANDSTONE = new BlockItem(ModBlocks.WAVY_SANDSTONE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem SOUL_SANDSTONE = new BlockItem(ModBlocks.SOUL_SANDSTONE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem CUT_SOUL_SANDSTONE = new BlockItem(ModBlocks.CUT_SOUL_SANDSTONE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem CHISELED_SOUL_SANDSTONE = new BlockItem(ModBlocks.CHISELED_SOUL_SANDSTONE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem WAVY_SOUL_SANDSTONE = new BlockItem(ModBlocks.WAVY_SOUL_SANDSTONE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - public static final BlockItem SMOOTH_SOUL_SANDSTONE = new BlockItem(ModBlocks.SMOOTH_SOUL_SANDSTONE, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)); - - public static void registerItems() { -///ITEMS: - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "golden_potato"), GOLDEN_POTATO); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "golden_sweet_berries"), GOLDEN_SWEET_BERRIES); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "golden_beetroot"), GOLDEN_BEETROOT); - -//BLOCKS: - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "corrite"), CORRITE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "borite"), BORITE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "wavy_sandstone"), WAVY_SANDSTONE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "soul_sandstone"), SOUL_SANDSTONE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "cut_soul_sandstone"), CUT_SOUL_SANDSTONE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "chiseled_soul_sandstone"), CHISELED_SOUL_SANDSTONE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "wavy_soul_sandstone"), WAVY_SOUL_SANDSTONE); - Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "smooth_soul_sandstone"), SMOOTH_SOUL_SANDSTONE); - } - -} +package com.jingy.jineric.registry; + +import com.jingy.jineric.Jineric; +import net.minecraft.item.BlockItem; +import net.minecraft.item.FoodComponent; +import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; +import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; + +public class Items { + + //FOODS: + public static final Item GOLDEN_POTATO = new Item( + new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder().hunger(6).saturationModifier(14.4f).build())); + + public static final Item GOLDEN_SWEET_BERRIES = new Item( + new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder().hunger(5).saturationModifier(8f).build())); + + public static final Item GOLDEN_BEETROOT = new Item( + new Item.Settings().group(ItemGroup.FOOD).food(new FoodComponent.Builder().hunger(4).saturationModifier(5f).build())); + + + + //BLOCK ITEMS: + public static final BlockItem CORRITE = new BlockItem(Blocks.CORRITE, ItemSettings.BuildingBlocks()); + public static final BlockItem BORITE = new BlockItem(Blocks.BORITE, ItemSettings.BuildingBlocks()); + public static final BlockItem WAVY_SANDSTONE = new BlockItem(Blocks.WAVY_SANDSTONE, ItemSettings.BuildingBlocks()); + public static final BlockItem SOUL_SANDSTONE = new BlockItem(Blocks.SOUL_SANDSTONE, ItemSettings.BuildingBlocks()); + public static final BlockItem CUT_SOUL_SANDSTONE = new BlockItem(Blocks.CUT_SOUL_SANDSTONE, ItemSettings.BuildingBlocks()); + public static final BlockItem CHISELED_SOUL_SANDSTONE = new BlockItem(Blocks.CHISELED_SOUL_SANDSTONE, ItemSettings.BuildingBlocks()); + public static final BlockItem WAVY_SOUL_SANDSTONE = new BlockItem(Blocks.WAVY_SOUL_SANDSTONE, ItemSettings.BuildingBlocks()); + public static final BlockItem SMOOTH_SOUL_SANDSTONE = new BlockItem(Blocks.SMOOTH_SOUL_SANDSTONE, ItemSettings.BuildingBlocks()); + + + public static void registerItems() { + //ITEMS: + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "golden_potato"), GOLDEN_POTATO); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "golden_sweet_berries"), GOLDEN_SWEET_BERRIES); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "golden_beetroot"), GOLDEN_BEETROOT); + + //BLOCKS: + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "corrite"), CORRITE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "borite"), BORITE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "wavy_sandstone"), WAVY_SANDSTONE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "soul_sandstone"), SOUL_SANDSTONE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "cut_soul_sandstone"), CUT_SOUL_SANDSTONE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "chiseled_soul_sandstone"), CHISELED_SOUL_SANDSTONE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "wavy_soul_sandstone"), WAVY_SOUL_SANDSTONE); + Registry.register(Registry.ITEM, new Identifier(Jineric.MOD_ID, "smooth_soul_sandstone"), SMOOTH_SOUL_SANDSTONE); + } +} \ No newline at end of file diff --git a/src/main/java/com/jingy/jineric/registry/ModBlocks.java b/src/main/java/com/jingy/jineric/registry/ModBlocks.java deleted file mode 100644 index fba7af57..00000000 --- a/src/main/java/com/jingy/jineric/registry/ModBlocks.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.jingy.jineric.registry; - -import com.jingy.jineric.Jineric; -import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; -import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; -import net.minecraft.block.Block; -import net.minecraft.block.Material; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; - -public class ModBlocks { - -//STONE BLOCKS: - public static final Block CORRITE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(1.5f, 30.0f) - .sounds(BlockSoundGroup.STONE)); - - public static final Block BORITE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(1.5f, 30.0f) - .sounds(BlockSoundGroup.STONE)); - -//SAND BLOCKS: - public static final Block WAVY_SANDSTONE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(0.8f, 4f) - .sounds(BlockSoundGroup.STONE)); - -//SOUL SAND BLOCKS: - - public static final Block SOUL_SANDSTONE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(0.8f, 4f) - .sounds(BlockSoundGroup.SOUL_SAND)); - - public static final Block CUT_SOUL_SANDSTONE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(0.8f, 4f) - .sounds(BlockSoundGroup.SOUL_SAND)); - - public static final Block CHISELED_SOUL_SANDSTONE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(0.8f, 4f) - .sounds(BlockSoundGroup.SOUL_SAND)); - - public static final Block WAVY_SOUL_SANDSTONE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(0.8f, 4f) - .sounds(BlockSoundGroup.SOUL_SAND)); - - public static final Block SMOOTH_SOUL_SANDSTONE = new Block(FabricBlockSettings - .of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES, 0) - .requiresTool() - .strength(0.8f, 4f) - .sounds(BlockSoundGroup.SOUL_SAND)); - - - - public static void registerBlocks() { -//STONES: - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "corrite"), CORRITE); - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "borite"), BORITE); - -//SANDS: - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "wavy_sandstone"), WAVY_SANDSTONE); - -//SOUL SANDS: - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "soul_sandstone"), SOUL_SANDSTONE); - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "cut_soul_sandstone"), CUT_SOUL_SANDSTONE); - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "chiseled_soul_sandstone"), CHISELED_SOUL_SANDSTONE); - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "wavy_soul_sandstone"), WAVY_SOUL_SANDSTONE); - Registry.register(Registry.BLOCK, new Identifier(Jineric.MOD_ID, "smooth_soul_sandstone"), SMOOTH_SOUL_SANDSTONE); - } -} diff --git a/src/main/resources/data/jineric/loot_tables/blocks/borite.json b/src/main/resources/data/jineric/loot_tables/blocks/borite.json index 2474d059..bcf15491 100644 --- a/src/main/resources/data/jineric/loot_tables/blocks/borite.json +++ b/src/main/resources/data/jineric/loot_tables/blocks/borite.json @@ -6,7 +6,7 @@ "entries": [ { "type": "minecraft:item", - "name": "jineric:borite", + "name": "jineric:borite" } ], "conditions": [ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 953915a6..cf111f51 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -13,7 +13,7 @@ "sources": "https://github.com/Jiingy/Jineric-Mod" }, - "license": "CC0-1.0", + "license": "MIT", "icon": "assets/jineric/icon.png", "environment": "*",