-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "Item Settings" and "BlockSettings"
- Loading branch information
Showing
8 changed files
with
153 additions
and
149 deletions.
There are no files selected for viewing
This file contains 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
29 changes: 29 additions & 0 deletions
29
src/main/java/com/jingy/jineric/registry/BlockSettings.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/jingy/jineric/registry/ItemSettings.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
104 changes: 52 additions & 52 deletions
104
.../com/jingy/jineric/registry/ModItems.java → ...ava/com/jingy/jineric/registry/Items.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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