neoforge stable 1.3.0+1.21.11
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
package dev.sillyangel.nuggetmod;
|
||||
|
||||
public final class ExampleMod {
|
||||
public static final String MOD_ID = "nuggetmod";
|
||||
|
||||
public static void init() {
|
||||
// Write common init code here.
|
||||
}
|
||||
}
|
||||
24
common/src/main/java/dev/sillyangel/nuggetmod/NuggetMod.java
Normal file
24
common/src/main/java/dev/sillyangel/nuggetmod/NuggetMod.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package dev.sillyangel.nuggetmod;
|
||||
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.sound.ModSounds;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public final class NuggetMod {
|
||||
public static final String MOD_ID = "nuggetmod";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
|
||||
|
||||
public static void init() {
|
||||
LOGGER.info("Initializing Nugget Mod");
|
||||
|
||||
// Initialize registries - order matters!
|
||||
ModSounds.init();
|
||||
ModItems.init();
|
||||
ModBlocks.init();
|
||||
|
||||
LOGGER.info("Nugget Mod initialized");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package dev.sillyangel.nuggetmod.block;
|
||||
|
||||
import dev.architectury.registry.registries.DeferredRegister;
|
||||
import dev.architectury.registry.registries.RegistrySupplier;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import net.minecraft.block.AbstractBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ExperienceDroppingBlock;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModBlocks {
|
||||
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(NuggetMod.MOD_ID, RegistryKeys.BLOCK);
|
||||
public static final DeferredRegister<Item> BLOCK_ITEMS = DeferredRegister.create(NuggetMod.MOD_ID, RegistryKeys.ITEM);
|
||||
|
||||
public static final RegistrySupplier<Block> NUGGET_BLOCK = registerBlockWithItem("nugget_block",
|
||||
() -> new Block(createBlockSettings("nugget_block")
|
||||
.strength(4f)
|
||||
.requiresTool()
|
||||
.sounds(BlockSoundGroup.AMETHYST_BLOCK)));
|
||||
|
||||
public static final RegistrySupplier<Block> RAW_NUGGET_BLOCK = registerBlockWithItem("raw_nugget_block",
|
||||
() -> new Block(createBlockSettings("raw_nugget_block")
|
||||
.strength(4f)
|
||||
.requiresTool()));
|
||||
|
||||
public static final RegistrySupplier<Block> NUGGET_ORE = registerBlockWithItem("nugget_ore",
|
||||
() -> new ExperienceDroppingBlock(UniformIntProvider.create(2, 5),
|
||||
createBlockSettings("nugget_ore")
|
||||
.strength(3f)
|
||||
.requiresTool()));
|
||||
|
||||
public static final RegistrySupplier<Block> NUGGET_DEEPSLATE_ORE = registerBlockWithItem("nugget_deepslate_ore",
|
||||
() -> new ExperienceDroppingBlock(UniformIntProvider.create(3, 6),
|
||||
createBlockSettings("nugget_deepslate_ore")
|
||||
.strength(4f)
|
||||
.requiresTool()
|
||||
.sounds(BlockSoundGroup.DEEPSLATE)));
|
||||
|
||||
private static <T extends Block> RegistrySupplier<T> registerBlockWithItem(String name, Supplier<T> block) {
|
||||
RegistrySupplier<T> toReturn = BLOCKS.register(name, block);
|
||||
BLOCK_ITEMS.register(name, () -> new BlockItem(toReturn.get(),
|
||||
new Item.Settings()
|
||||
.useBlockPrefixedTranslationKey()
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(NuggetMod.MOD_ID, name)))));
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
private static AbstractBlock.Settings createBlockSettings(String name) {
|
||||
return AbstractBlock.Settings.create()
|
||||
.registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(NuggetMod.MOD_ID, name)));
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
BLOCKS.register();
|
||||
BLOCK_ITEMS.register();
|
||||
NuggetMod.LOGGER.info("Registering Mod Blocks for " + NuggetMod.MOD_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.item;
|
||||
package dev.sillyangel.nuggetmod.item;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.fabric.util.ModTags;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.util.ModTags;
|
||||
import net.minecraft.item.equipment.ArmorMaterial;
|
||||
import net.minecraft.item.equipment.EquipmentAsset;
|
||||
import net.minecraft.item.equipment.EquipmentType;
|
||||
@@ -24,4 +24,5 @@ public class ModArmorMaterials {
|
||||
map.put(EquipmentType.HELMET, 3);
|
||||
map.put(EquipmentType.BODY, 19);
|
||||
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 4.0F, 0.1F, ModTags.Items.REPAIRS_NUGGET_ARMOR, NUGGET_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.item;
|
||||
package dev.sillyangel.nuggetmod.item;
|
||||
|
||||
import net.minecraft.component.type.FoodComponent;
|
||||
|
||||
public class ModFoodComponents {
|
||||
public static final FoodComponent NUGGET = new FoodComponent.Builder().nutrition(5).saturationModifier(0.5f).build();
|
||||
public static final FoodComponent NUGGET = new FoodComponent.Builder()
|
||||
.nutrition(5)
|
||||
.saturationModifier(0.5f)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package dev.sillyangel.nuggetmod.item;
|
||||
|
||||
import dev.architectury.registry.registries.DeferredRegister;
|
||||
import dev.architectury.registry.registries.RegistrySupplier;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.sound.ModSounds;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.equipment.EquipmentType;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModItems {
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(NuggetMod.MOD_ID, RegistryKeys.ITEM);
|
||||
|
||||
// Basic Items
|
||||
public static final RegistrySupplier<Item> NUGGET = ITEMS.register("nugget",
|
||||
() -> new Item(createSettings("nugget").food(ModFoodComponents.NUGGET)));
|
||||
|
||||
public static final RegistrySupplier<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
|
||||
() -> new Item(createSettings("raw_nugget")));
|
||||
|
||||
// Tools
|
||||
public static final RegistrySupplier<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
|
||||
() -> new Item(createSettings("nugget_sword").sword(ModToolMaterials.NUGGET, 3.0F, -2.4F)));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
|
||||
() -> new Item(createSettings("nugget_pickaxe").pickaxe(ModToolMaterials.NUGGET, 1.0F, -2.8F)));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
|
||||
() -> new ShovelItem(ModToolMaterials.NUGGET, 1.5F, -3.0F, createSettings("nugget_shovel")));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
|
||||
() -> new AxeItem(ModToolMaterials.NUGGET, 6.0F, -3.2F, createSettings("nugget_axe")));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
|
||||
() -> new HoeItem(ModToolMaterials.NUGGET, -3.0F, 0.0F, createSettings("nugget_hoe")));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_SPEAR = ITEMS.register("nugget_spear",
|
||||
() -> new Item(createSettings("nugget_spear").spear(ModToolMaterials.NUGGET, 1F, 1.08F, 0.2F, 3.5F, 5.5F, 6.5F, 5.1F, 10.0F, 4.6F)));
|
||||
|
||||
// Armor
|
||||
public static final RegistrySupplier<Item> NUGGET_HELMET = ITEMS.register("nugget_helmet",
|
||||
() -> new Item(createSettings("nugget_helmet").armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.HELMET)));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_CHESTPLATE = ITEMS.register("nugget_chestplate",
|
||||
() -> new Item(createSettings("nugget_chestplate").armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.CHESTPLATE)));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_LEGGINGS = ITEMS.register("nugget_leggings",
|
||||
() -> new Item(createSettings("nugget_leggings").armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.LEGGINGS)));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_BOOTS = ITEMS.register("nugget_boots",
|
||||
() -> new Item(createSettings("nugget_boots").armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.BOOTS)));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_HORSE_ARMOR = ITEMS.register("nugget_horse_armor",
|
||||
() -> new Item(createSettings("nugget_horse_armor").horseArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL)));
|
||||
|
||||
// Special Items
|
||||
public static final RegistrySupplier<Item> NUGGET_SMITHING_TEMPLATE = ITEMS.register("nugget_armor_trim_smithing_template",
|
||||
() -> SmithingTemplateItem.of(createSettings("nugget_armor_trim_smithing_template")));
|
||||
|
||||
public static final RegistrySupplier<Item> NUGGET_MUSIC_DISC = ITEMS.register("nugget_music_disc",
|
||||
() -> new Item(createSettings("nugget_music_disc").jukeboxPlayable(ModSounds.NUGGET_THEME_KEY).maxCount(1)));
|
||||
|
||||
private static Item.Settings createSettings(String name) {
|
||||
return new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(NuggetMod.MOD_ID, name)));
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
ITEMS.register();
|
||||
NuggetMod.LOGGER.info("Registering Mod Items for " + NuggetMod.MOD_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.item;
|
||||
package dev.sillyangel.nuggetmod.item;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.util.ModTags;
|
||||
import dev.sillyangel.nuggetmod.util.ModTags;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
|
||||
public class ModToolMaterials {
|
||||
@@ -12,4 +12,5 @@ public class ModToolMaterials {
|
||||
22,
|
||||
ModTags.Items.NUGGET_TOOL_MATERIALS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package dev.sillyangel.nuggetmod.sound;
|
||||
|
||||
import dev.architectury.registry.registries.DeferredRegister;
|
||||
import dev.architectury.registry.registries.RegistrySupplier;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import net.minecraft.block.jukebox.JukeboxSong;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModSounds {
|
||||
public static final DeferredRegister<SoundEvent> SOUND_EVENTS = DeferredRegister.create(NuggetMod.MOD_ID, RegistryKeys.SOUND_EVENT);
|
||||
|
||||
public static final RegistrySupplier<SoundEvent> NUGGET_THEME = SOUND_EVENTS.register("nugget_theme",
|
||||
() -> SoundEvent.of(Identifier.of(NuggetMod.MOD_ID, "nugget_theme")));
|
||||
|
||||
public static final RegistryKey<JukeboxSong> NUGGET_THEME_KEY =
|
||||
RegistryKey.of(RegistryKeys.JUKEBOX_SONG, Identifier.of(NuggetMod.MOD_ID, "nugget_theme"));
|
||||
|
||||
public static void init() {
|
||||
SOUND_EVENTS.register();
|
||||
NuggetMod.LOGGER.info("Registering Mod Sounds for " + NuggetMod.MOD_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.trim;
|
||||
package dev.sillyangel.nuggetmod.trim;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.equipment.trim.ArmorTrimAssets;
|
||||
import net.minecraft.item.equipment.trim.ArmorTrimMaterial;
|
||||
@@ -22,7 +22,7 @@ public class ModTrimMaterials {
|
||||
Identifier.of(NuggetMod.MOD_ID, "nugget"));
|
||||
|
||||
public static void bootstrap(Registerable<ArmorTrimMaterial> registerable) {
|
||||
register(registerable, NUGGET, Registries.ITEM.getEntry(ModItems.NUGGET),
|
||||
register(registerable, NUGGET, Registries.ITEM.getEntry(ModItems.NUGGET.get()),
|
||||
Style.EMPTY.withColor(TextColor.parse("#f9b042").getOrThrow()));
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.trim;
|
||||
package dev.sillyangel.nuggetmod.trim;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.equipment.trim.ArmorTrimPattern;
|
||||
import net.minecraft.registry.Registerable;
|
||||
@@ -16,7 +16,7 @@ public class ModTrimPatterns {
|
||||
Identifier.of(NuggetMod.MOD_ID, "nugget"));
|
||||
|
||||
public static void bootstrap(Registerable<ArmorTrimPattern> context) {
|
||||
register(context, ModItems.NUGGET_SMITHING_TEMPLATE, NUGGET);
|
||||
register(context, ModItems.NUGGET_SMITHING_TEMPLATE.get(), NUGGET);
|
||||
}
|
||||
|
||||
private static void register(Registerable<ArmorTrimPattern> context, Item item, RegistryKey<ArmorTrimPattern> key) {
|
||||
@@ -1,11 +1,11 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.util;
|
||||
package dev.sillyangel.nuggetmod.util;
|
||||
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.registry.tag.TagKey;
|
||||
import net.minecraft.util.Identifier;
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
|
||||
public class ModTags {
|
||||
public static class Blocks {
|
||||
@@ -18,7 +18,6 @@ public class ModTags {
|
||||
}
|
||||
|
||||
public static class Items {
|
||||
// public static final TagKey<Item> TRANSFORMABLE_ITEMS = createTag("transformable_items");
|
||||
public static final TagKey<Item> NUGGET_TOOL_MATERIALS = createTag("nugget_tool_materials");
|
||||
public static final TagKey<Item> REPAIRS_NUGGET_ARMOR = createTag("repairs_nugget_armor");
|
||||
|
||||
@@ -27,3 +26,4 @@ public class ModTags {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.world;
|
||||
package dev.sillyangel.nuggetmod.worldgen;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
@@ -9,37 +10,24 @@ import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.gen.feature.FeatureConfig;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.structure.rule.BlockMatchRuleTest;
|
||||
import net.minecraft.structure.rule.RuleTest;
|
||||
import net.minecraft.structure.rule.TagMatchRuleTest;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ModConfiguredFeatures {
|
||||
public static final RegistryKey<ConfiguredFeature<?, ?>> NUGGET_ORE_KEY = registerKey("nugget_ore");
|
||||
// public static final RegistryKey<ConfiguredFeature<?, ?>> NETHER_NUGGET_ORE_KEY = registerKey("nether_nugget_ore");
|
||||
// public static final RegistryKey<ConfiguredFeature<?, ?>> END_NUGGET_ORE_KEY = registerKey("end_nugget_ore");
|
||||
|
||||
public static void bootstrap(Registerable<ConfiguredFeature<?, ?>> context) {
|
||||
RuleTest stoneReplaceables = new TagMatchRuleTest(BlockTags.STONE_ORE_REPLACEABLES);
|
||||
RuleTest deepslateReplaceables = new TagMatchRuleTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES);
|
||||
// RuleTest netherReplaceables = new TagMatchRuleTest(BlockTags.BASE_STONE_NETHER);
|
||||
// RuleTest endReplaceables = new BlockMatchRuleTest(Blocks.END_STONE);
|
||||
|
||||
List<OreFeatureConfig.Target> overworldPinkGarnetOres =
|
||||
List.of(OreFeatureConfig.createTarget(stoneReplaceables, ModBlocks.NUGGET_ORE.getDefaultState()),
|
||||
OreFeatureConfig.createTarget(deepslateReplaceables, ModBlocks.NUGGET_DEEPSLATE_ORE.getDefaultState()));
|
||||
// List<OreFeatureConfig.Target> netherPinkGarnetOres =
|
||||
// List.of(OreFeatureConfig.createTarget(netherReplaceables, ModBlocks.NUGGET_NETHER_ORE.getDefaultState()));
|
||||
// List<OreFeatureConfig.Target> endPinkGarnetOres =
|
||||
// List.of(OreFeatureConfig.createTarget(endReplaceables, ModBlocks.NUGGET_END_ORE.getDefaultState()));
|
||||
List<OreFeatureConfig.Target> overworldNuggetOres =
|
||||
List.of(OreFeatureConfig.createTarget(stoneReplaceables, ModBlocks.NUGGET_ORE.get().getDefaultState()),
|
||||
OreFeatureConfig.createTarget(deepslateReplaceables, ModBlocks.NUGGET_DEEPSLATE_ORE.get().getDefaultState()));
|
||||
|
||||
register(context, NUGGET_ORE_KEY, Feature.ORE, new OreFeatureConfig(overworldPinkGarnetOres, 12));
|
||||
// register(context, NETHER_NUGGET_ORE_KEY, Feature.ORE, new OreFeatureConfig(netherPinkGarnetOres, 9));
|
||||
// register(context, END_NUGGET_ORE_KEY, Feature.ORE, new OreFeatureConfig(endPinkGarnetOres, 9));
|
||||
register(context, NUGGET_ORE_KEY, Feature.ORE, new OreFeatureConfig(overworldNuggetOres, 12));
|
||||
}
|
||||
|
||||
public static RegistryKey<ConfiguredFeature<?, ?>> registerKey(String name) {
|
||||
@@ -50,4 +38,5 @@ public class ModConfiguredFeatures {
|
||||
RegistryKey<ConfiguredFeature<?, ?>> key, F feature, FC configuration) {
|
||||
context.register(key, new ConfiguredFeature<>(feature, configuration));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.world;
|
||||
package dev.sillyangel.nuggetmod.worldgen;
|
||||
|
||||
import net.minecraft.world.gen.placementmodifier.*;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.world;
|
||||
package dev.sillyangel.nuggetmod.worldgen;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import net.minecraft.registry.Registerable;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
@@ -1,14 +1,15 @@
|
||||
package dev.sillyangel.nuggetmod.fabric;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItemGroups;
|
||||
import dev.sillyangel.nuggetmod.fabric.particle.ModParticles;
|
||||
import dev.sillyangel.nuggetmod.fabric.villager.ModVillagers;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItemGroups;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.fabric.sound.ModSounds;
|
||||
import dev.sillyangel.nuggetmod.fabric.world.gen.ModWorldGeneration;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.fabric.world.ModWorldGeneration;
|
||||
import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback;
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.village.TradeOffer;
|
||||
import net.minecraft.village.TradedItem;
|
||||
@@ -26,56 +27,71 @@ public class NuggetMod implements ModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
LOGGER.info("Initializing Nugget");
|
||||
LOGGER.info("Initializing Nugget (Fabric)");
|
||||
|
||||
// Initialize common mod
|
||||
dev.sillyangel.nuggetmod.NuggetMod.init();
|
||||
|
||||
// Fabric-specific registrations
|
||||
ModItemGroups.registerItemGroups();
|
||||
ModItems.registerModItems();
|
||||
ModBlocks.registerModBlocks();
|
||||
ModSounds.registerSounds();
|
||||
ModWorldGeneration.generateModWorldGen();
|
||||
ModVillagers.registerVillagers();
|
||||
ModParticles.registerParticles();
|
||||
|
||||
// Register tooltip for nugget item using Fabric API
|
||||
ItemTooltipCallback.EVENT.register((itemStack, tooltipContext, tooltipType, list) -> {
|
||||
if (itemStack.isOf(ModItems.NUGGET)) {
|
||||
if (itemStack.isOf(ModItems.NUGGET.get())) {
|
||||
list.add(Text.translatable("item.nuggetmod.nugget.tooltip"));
|
||||
}
|
||||
});
|
||||
|
||||
// Add items to vanilla creative tabs
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(entries -> {
|
||||
entries.add(ModItems.NUGGET.get());
|
||||
entries.add(ModItems.RAW_NUGGET.get());
|
||||
});
|
||||
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(entries -> {
|
||||
entries.add(ModBlocks.NUGGET_BLOCK.get());
|
||||
entries.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
});
|
||||
|
||||
// Villager trades
|
||||
TradeOfferHelper.registerVillagerOffers(VillagerProfession.FARMER, 1, factories -> {
|
||||
factories.add((world,entity, random) -> new TradeOffer(
|
||||
new TradedItem(Items.EMERALD, 3),
|
||||
new ItemStack(ModItems.NUGGET, 8), 7, 2, 0.04f));
|
||||
new ItemStack(ModItems.NUGGET.get(), 8), 7, 2, 0.04f));
|
||||
});
|
||||
|
||||
TradeOfferHelper.registerVillagerOffers(ModVillagers.NUGGETER_KEY, 1, factories -> {
|
||||
factories.add((world,entity, random) -> new TradeOffer(
|
||||
new TradedItem(Items.EMERALD, 5),
|
||||
new ItemStack(ModItems.NUGGET, 20), 4, 7, 0.04f));
|
||||
new ItemStack(ModItems.NUGGET.get(), 20), 4, 7, 0.04f));
|
||||
|
||||
factories.add((world,entity, random) -> new TradeOffer(
|
||||
new TradedItem(ModItems.NUGGET, 16),
|
||||
new ItemStack(ModItems.NUGGET_HORSE_ARMOR, 1), 4, 7, 0.04f));
|
||||
new TradedItem(ModItems.NUGGET.get(), 16),
|
||||
new ItemStack(ModItems.NUGGET_HORSE_ARMOR.get(), 1), 4, 7, 0.04f));
|
||||
});
|
||||
|
||||
TradeOfferHelper.registerVillagerOffers(ModVillagers.NUGGETER_KEY, 2, factories -> {
|
||||
factories.add((world,entity, random) -> new TradeOffer(
|
||||
new TradedItem(ModItems.NUGGET, 10),
|
||||
new ItemStack(ModItems.NUGGET_SMITHING_TEMPLATE, 1), 4, 7, 0.04f));
|
||||
new TradedItem(ModItems.NUGGET.get(), 10),
|
||||
new ItemStack(ModItems.NUGGET_SMITHING_TEMPLATE.get(), 1), 4, 7, 0.04f));
|
||||
|
||||
factories.add((world,entity, random) -> new TradeOffer(
|
||||
new TradedItem(ModItems.NUGGET, 10),
|
||||
new ItemStack(ModItems.NUGGET_MUSIC_DISC, 1), 3, 12, 0.09f));
|
||||
new TradedItem(ModItems.NUGGET.get(), 10),
|
||||
new ItemStack(ModItems.NUGGET_MUSIC_DISC.get(), 1), 3, 12, 0.09f));
|
||||
});
|
||||
|
||||
TradeOfferHelper.registerWanderingTraderOffers(factories -> {
|
||||
factories.addAll(Identifier.of(NuggetMod.MOD_ID, "emerald_for_nuggetsmithing"), (world, entity, random) -> new TradeOffer(
|
||||
new TradedItem(Items.EMERALD, 25),
|
||||
new ItemStack(ModItems. NUGGET_SMITHING_TEMPLATE, 1), 4, 7, 0.04f));
|
||||
new ItemStack(ModItems.NUGGET_SMITHING_TEMPLATE.get(), 1), 4, 7, 0.04f));
|
||||
|
||||
factories.addAll(Identifier.of(NuggetMod.MOD_ID, "nuggets_to_musicdisc"), (world, entity, random) -> new TradeOffer(
|
||||
new TradedItem(ModItems.NUGGET, 15),
|
||||
new ItemStack(ModItems.NUGGET_MUSIC_DISC, 1), 3, 12, 0.09f));
|
||||
new TradedItem(ModItems.NUGGET.get(), 15),
|
||||
new ItemStack(ModItems.NUGGET_MUSIC_DISC.get(), 1), 3, 12, 0.09f));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package dev.sillyangel.nuggetmod.fabric;
|
||||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
import dev.sillyangel.nuggetmod.fabric.datagen.*;
|
||||
import dev.sillyangel.nuggetmod.fabric.trim.ModTrimMaterials;
|
||||
import dev.sillyangel.nuggetmod.fabric.trim.ModTrimPatterns;
|
||||
import dev.sillyangel.nuggetmod.trim.ModTrimMaterials;
|
||||
import dev.sillyangel.nuggetmod.trim.ModTrimPatterns;
|
||||
import net.minecraft.registry.RegistryBuilder;
|
||||
import dev.sillyangel.nuggetmod.fabric.world.ModConfiguredFeatures;
|
||||
import dev.sillyangel.nuggetmod.fabric.world.ModPlacedFeatures;
|
||||
import dev.sillyangel.nuggetmod.worldgen.ModConfiguredFeatures;
|
||||
import dev.sillyangel.nuggetmod.worldgen.ModPlacedFeatures;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
|
||||
public class NuggetModDataGenerator implements DataGeneratorEntrypoint {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.block;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.block.enums.NoteBlockInstrument;
|
||||
import net.minecraft.block.piston.PistonBehavior;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ModBlocks {
|
||||
|
||||
public static final Block NUGGET_BLOCK = registerBlock("nugget_block",
|
||||
properties -> new Block(properties.strength(4f)
|
||||
.requiresTool().sounds(BlockSoundGroup.AMETHYST_BLOCK)));
|
||||
public static final Block RAW_NUGGET_BLOCK = registerBlock("raw_nugget_block",
|
||||
properties -> new Block(properties.strength(4f)
|
||||
.requiresTool()));
|
||||
|
||||
public static final Block NUGGET_ORE = registerBlock("nugget_ore",
|
||||
properties -> new ExperienceDroppingBlock(UniformIntProvider.create(2, 5),
|
||||
properties.strength(3f).requiresTool()));
|
||||
|
||||
public static final Block NUGGET_DEEPSLATE_ORE = registerBlock("nugget_deepslate_ore",
|
||||
properties -> new ExperienceDroppingBlock(UniformIntProvider.create(3, 6),
|
||||
properties.strength(4f).requiresTool().sounds(BlockSoundGroup.DEEPSLATE)));
|
||||
|
||||
private static Block registerBlock(String name, Function<AbstractBlock.Settings, Block> function) {
|
||||
Block toRegister = function.apply(AbstractBlock.Settings.create().registryKey(RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(NuggetMod.MOD_ID, name))));
|
||||
registerBlockItem(name, toRegister);
|
||||
return Registry.register(Registries.BLOCK, Identifier.of(NuggetMod.MOD_ID, name), toRegister);
|
||||
}
|
||||
|
||||
private static void registerBlockItem(String name, Block block) {
|
||||
Registry.register(Registries.ITEM, Identifier.of(NuggetMod.MOD_ID, name),
|
||||
new BlockItem(block, new Item.Settings().useBlockPrefixedTranslationKey()
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(NuggetMod.MOD_ID, name)))));
|
||||
}
|
||||
public static void registerModBlocks() {
|
||||
NuggetMod.LOGGER.info("Registering Mod Blocks for " + NuggetMod.MOD_ID);
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.BUILDING_BLOCKS).register(entries -> {
|
||||
entries.add(NUGGET_BLOCK);
|
||||
entries.add(RAW_NUGGET_BLOCK);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,10 @@ package dev.sillyangel.nuggetmod.fabric.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.util.ModTags;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import dev.sillyangel.nuggetmod.fabric.util.ModTags;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@@ -17,21 +17,22 @@ public class ModBlockTagProvider extends FabricTagProvider.BlockTagProvider {
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||
valueLookupBuilder(BlockTags.PICKAXE_MINEABLE)
|
||||
.add(ModBlocks.NUGGET_BLOCK)
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK)
|
||||
.add(ModBlocks.NUGGET_ORE)
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE);
|
||||
.add(ModBlocks.NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.NUGGET_ORE.get())
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
valueLookupBuilder(BlockTags.NEEDS_STONE_TOOL)
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE)
|
||||
.add(ModBlocks.NUGGET_BLOCK)
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK);
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get())
|
||||
.add(ModBlocks.NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
valueLookupBuilder(BlockTags.NEEDS_DIAMOND_TOOL)
|
||||
.add(ModBlocks.NUGGET_BLOCK);
|
||||
.add(ModBlocks.NUGGET_BLOCK.get());
|
||||
|
||||
valueLookupBuilder(ModTags.Blocks.NEEDS_NUGGET_TOOL)
|
||||
.addTag(BlockTags.NEEDS_DIAMOND_TOOL)
|
||||
.add(ModBlocks.NUGGET_BLOCK);
|
||||
.add(ModBlocks.NUGGET_BLOCK.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package dev.sillyangel.nuggetmod.fabric.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.registry.tag.ItemTags;
|
||||
|
||||
@@ -15,30 +15,25 @@ public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
|
||||
|
||||
@Override
|
||||
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||
// getOrCreateTagBuilder(ModTags.Items.TRANSFORMABLE_ITEMS)
|
||||
// .add(ModItems.NUGGET)
|
||||
// .add(ModItems.RAW_NUGGET)
|
||||
// .add(Items.COAL)
|
||||
// .add(Items.STICK)
|
||||
// .add(Items.APPLE);
|
||||
valueLookupBuilder(ItemTags.SWORDS)
|
||||
.add(ModItems.NUGGET_SWORD);
|
||||
.add(ModItems.NUGGET_SWORD.get());
|
||||
valueLookupBuilder(ItemTags.PICKAXES)
|
||||
.add(ModItems.NUGGET_PICKAXE);
|
||||
.add(ModItems.NUGGET_PICKAXE.get());
|
||||
valueLookupBuilder(ItemTags.SHOVELS)
|
||||
.add(ModItems.NUGGET_SHOVEL);
|
||||
.add(ModItems.NUGGET_SHOVEL.get());
|
||||
valueLookupBuilder(ItemTags.AXES)
|
||||
.add(ModItems.NUGGET_AXE);
|
||||
.add(ModItems.NUGGET_AXE.get());
|
||||
valueLookupBuilder(ItemTags.HOES)
|
||||
.add(ModItems.NUGGET_HOE);
|
||||
.add(ModItems.NUGGET_HOE.get());
|
||||
valueLookupBuilder(ItemTags.SPEARS)
|
||||
.add(ModItems.NUGGET_SPEAR);
|
||||
.add(ModItems.NUGGET_SPEAR.get());
|
||||
valueLookupBuilder(ItemTags.TRIMMABLE_ARMOR)
|
||||
.add(ModItems.NUGGET_HELMET)
|
||||
.add(ModItems.NUGGET_CHESTPLATE)
|
||||
.add(ModItems.NUGGET_LEGGINGS)
|
||||
.add(ModItems.NUGGET_BOOTS);
|
||||
.add(ModItems.NUGGET_HELMET.get())
|
||||
.add(ModItems.NUGGET_CHESTPLATE.get())
|
||||
.add(ModItems.NUGGET_LEGGINGS.get())
|
||||
.add(ModItems.NUGGET_BOOTS.get());
|
||||
valueLookupBuilder(ItemTags.TRIM_MATERIALS)
|
||||
.add(ModItems.NUGGET);
|
||||
.add(ModItems.NUGGET.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package dev.sillyangel.nuggetmod.fabric.datagen;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
@@ -26,11 +26,11 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
addDrop(ModBlocks.NUGGET_BLOCK);
|
||||
addDrop(ModBlocks.RAW_NUGGET_BLOCK);
|
||||
addDrop(ModBlocks.NUGGET_BLOCK.get());
|
||||
addDrop(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
addDrop(ModBlocks.NUGGET_ORE, oreDrops(ModBlocks.NUGGET_ORE, ModItems.RAW_NUGGET));
|
||||
addDrop(ModBlocks.NUGGET_DEEPSLATE_ORE, multipleOreDrops(ModBlocks.NUGGET_DEEPSLATE_ORE, ModItems.RAW_NUGGET, 2, 6));
|
||||
addDrop(ModBlocks.NUGGET_ORE.get(), oreDrops(ModBlocks.NUGGET_ORE.get(), ModItems.RAW_NUGGET.get()));
|
||||
addDrop(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), multipleOreDrops(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), ModItems.RAW_NUGGET.get(), 2, 6));
|
||||
}
|
||||
|
||||
public LootTable.Builder multipleOreDrops(Block drop, Item item, float minDrops, float maxDrops) {
|
||||
@@ -39,4 +39,5 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
|
||||
ItemEntry.builder(item).apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(minDrops, maxDrops))))
|
||||
.apply(ApplyBonusLootFunction.oreDrops(impl.getOrThrow(Enchantments.FORTUNE)))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.datagen;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModArmorMaterials;
|
||||
import dev.sillyangel.nuggetmod.item.ModArmorMaterials;
|
||||
import net.fabricmc.fabric.api.client.datagen.v1.provider.FabricModelProvider;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import net.minecraft.client.data.*;
|
||||
|
||||
public class ModModelProvider extends FabricModelProvider {
|
||||
@@ -14,35 +14,36 @@ public class ModModelProvider extends FabricModelProvider {
|
||||
// Blocks are generated here
|
||||
@Override
|
||||
public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) {
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NUGGET_BLOCK);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.RAW_NUGGET_BLOCK);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NUGGET_ORE);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NUGGET_DEEPSLATE_ORE);
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NUGGET_BLOCK.get());
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NUGGET_ORE.get());
|
||||
blockStateModelGenerator.registerSimpleCubeAll(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
}
|
||||
// Items are generated here
|
||||
@Override
|
||||
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
|
||||
itemModelGenerator.register(ModItems.NUGGET, Models.GENERATED);
|
||||
itemModelGenerator.register(ModItems.RAW_NUGGET, Models.GENERATED);
|
||||
itemModelGenerator.register(ModItems.NUGGET.get(), Models.GENERATED);
|
||||
itemModelGenerator.register(ModItems.RAW_NUGGET.get(), Models.GENERATED);
|
||||
|
||||
itemModelGenerator.register(ModItems.NUGGET_SWORD, Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_PICKAXE, Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_SHOVEL, Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_AXE, Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_HOE, Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_SWORD.get(), Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_PICKAXE.get(), Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_SHOVEL.get(), Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_AXE.get(), Models.HANDHELD);
|
||||
itemModelGenerator.register(ModItems.NUGGET_HOE.get(), Models.HANDHELD);
|
||||
|
||||
itemModelGenerator.register(ModItems.NUGGET_SPEAR, Models.SPEAR_IN_HAND);
|
||||
itemModelGenerator.register(ModItems.NUGGET_SPEAR.get(), Models.SPEAR_IN_HAND);
|
||||
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_HELMET, ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.HELMET_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_CHESTPLATE, ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.CHESTPLATE_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_LEGGINGS, ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.LEGGINGS_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_BOOTS, ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.BOOTS_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_HELMET.get(), ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.HELMET_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_CHESTPLATE.get(), ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.CHESTPLATE_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_LEGGINGS.get(), ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.LEGGINGS_TRIM_ID_PREFIX, false);
|
||||
itemModelGenerator.registerArmor(ModItems.NUGGET_BOOTS.get(), ModArmorMaterials.NUGGET_KEY, ItemModelGenerator.BOOTS_TRIM_ID_PREFIX, false);
|
||||
|
||||
itemModelGenerator.register(ModItems.NUGGET_HORSE_ARMOR, Models.GENERATED);
|
||||
itemModelGenerator.register(ModItems.NUGGET_HORSE_ARMOR.get(), Models.GENERATED);
|
||||
|
||||
itemModelGenerator.register(ModItems.NUGGET_SMITHING_TEMPLATE, Models.GENERATED);
|
||||
itemModelGenerator.register(ModItems.NUGGET_SMITHING_TEMPLATE.get(), Models.GENERATED);
|
||||
|
||||
itemModelGenerator.register(ModItems.NUGGET_MUSIC_DISC, Models.GENERATED);
|
||||
itemModelGenerator.register(ModItems.NUGGET_MUSIC_DISC.get(), Models.GENERATED);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||
import net.minecraft.item.Items;
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.fabric.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.fabric.trim.ModTrimPatterns;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.trim.ModTrimPatterns;
|
||||
import net.minecraft.data.recipe.RecipeExporter;
|
||||
import net.minecraft.data.recipe.RecipeGenerator;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
@@ -29,115 +29,115 @@ public class ModRecipeProvider extends FabricRecipeProvider {
|
||||
return new RecipeGenerator(wrapperLookup, recipeExporter) {
|
||||
@Override
|
||||
public void generate() {
|
||||
List<ItemConvertible> NUGGET_SMELTABLES = List.of(ModItems.RAW_NUGGET, ModBlocks.NUGGET_ORE,
|
||||
ModBlocks.NUGGET_DEEPSLATE_ORE);
|
||||
List<ItemConvertible> NUGGET_SMELTABLES = List.of(ModItems.RAW_NUGGET.get(), ModBlocks.NUGGET_ORE.get(),
|
||||
ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
offerSmelting(NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET, 0.25f, 200, "nugget");
|
||||
offerBlasting(NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET, 0.25f, 100, "nugget");
|
||||
offerSmelting(NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
|
||||
offerBlasting(NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget");
|
||||
|
||||
offerReversibleCompactingRecipes(RecipeCategory.BUILDING_BLOCKS, ModItems.NUGGET, RecipeCategory.DECORATIONS, ModBlocks.NUGGET_BLOCK);
|
||||
offerReversibleCompactingRecipes(RecipeCategory.BUILDING_BLOCKS, ModItems.NUGGET.get(), RecipeCategory.DECORATIONS, ModBlocks.NUGGET_BLOCK.get());
|
||||
|
||||
// RAW_NUGGET_BLOCK
|
||||
createShaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK)
|
||||
createShaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.pattern("RRR")
|
||||
.pattern("RRR")
|
||||
.pattern("RRR")
|
||||
.input('R', ModItems.RAW_NUGGET)
|
||||
.criterion(hasItem(ModItems.RAW_NUGGET), conditionsFromItem(ModItems.RAW_NUGGET))
|
||||
.input('R', ModItems.RAW_NUGGET.get())
|
||||
.criterion(hasItem(ModItems.RAW_NUGGET.get()), conditionsFromItem(ModItems.RAW_NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET, 9)
|
||||
.input(ModBlocks.RAW_NUGGET_BLOCK)
|
||||
.criterion(hasItem(ModBlocks.RAW_NUGGET_BLOCK), conditionsFromItem(ModBlocks.RAW_NUGGET_BLOCK))
|
||||
createShapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET.get(), 9)
|
||||
.input(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.criterion(hasItem(ModBlocks.RAW_NUGGET_BLOCK.get()), conditionsFromItem(ModBlocks.RAW_NUGGET_BLOCK.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
// TOOLS
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_SWORD)
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_SWORD.get())
|
||||
.pattern(" N ")
|
||||
.pattern(" N ")
|
||||
.pattern(" S ")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.input('S', Items.STICK)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_PICKAXE)
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_PICKAXE.get())
|
||||
.pattern("NNN")
|
||||
.pattern(" S ")
|
||||
.pattern(" S ")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.input('S', Items.STICK)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_AXE)
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_AXE.get())
|
||||
.pattern(" NN")
|
||||
.pattern(" SN")
|
||||
.pattern(" S ")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.input('S', Items.STICK)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_SHOVEL)
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_SHOVEL.get())
|
||||
.pattern(" N ")
|
||||
.pattern(" S ")
|
||||
.pattern(" S ")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.input('S', Items.STICK)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_HOE)
|
||||
createShaped(RecipeCategory.TOOLS, ModItems.NUGGET_HOE.get())
|
||||
.pattern(" NN")
|
||||
.pattern(" S ")
|
||||
.pattern(" S ")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.input('S', Items.STICK)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_SPEAR)
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_SPEAR.get())
|
||||
.pattern(" N")
|
||||
.pattern(" S ")
|
||||
.pattern("S ")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.input('S', Items.STICK)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
// ARMOR
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_HELMET)
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_HELMET.get())
|
||||
.pattern("NNN")
|
||||
.pattern("N N")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_CHESTPLATE)
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_CHESTPLATE.get())
|
||||
.pattern("N N")
|
||||
.pattern("NNN")
|
||||
.pattern("NNN")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_LEGGINGS)
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_LEGGINGS.get())
|
||||
.pattern("NNN")
|
||||
.pattern("N N")
|
||||
.pattern("N N")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_BOOTS)
|
||||
createShaped(RecipeCategory.COMBAT, ModItems.NUGGET_BOOTS.get())
|
||||
.pattern("N N")
|
||||
.pattern("N N")
|
||||
.input('N', ModItems.NUGGET)
|
||||
.criterion(hasItem(ModItems.NUGGET), conditionsFromItem(ModItems.NUGGET))
|
||||
.input('N', ModItems.NUGGET.get())
|
||||
.criterion(hasItem(ModItems.NUGGET.get()), conditionsFromItem(ModItems.NUGGET.get()))
|
||||
.offerTo(exporter);
|
||||
|
||||
offerSmithingTrimRecipe(ModItems.NUGGET_SMITHING_TEMPLATE, ModTrimPatterns.NUGGET,
|
||||
offerSmithingTrimRecipe(ModItems.NUGGET_SMITHING_TEMPLATE.get(), ModTrimPatterns.NUGGET,
|
||||
RegistryKey.of(RegistryKeys.RECIPE, Identifier.of(NuggetMod.MOD_ID, "nugget_smithing_template")));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.item;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
|
||||
import dev.sillyangel.nuggetmod.fabric.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -14,40 +15,42 @@ public class ModItemGroups {
|
||||
|
||||
public static final ItemGroup NUGGET_BLOCKS_GROUP = Registry.register(Registries.ITEM_GROUP,
|
||||
Identifier.of(NuggetMod.MOD_ID, "nugget_blocks"),
|
||||
FabricItemGroup.builder().icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK))
|
||||
FabricItemGroup.builder().icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK.get()))
|
||||
.displayName(Text.translatable("creativetab.nuggetmod.nugget_blocks"))
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(ModBlocks.NUGGET_BLOCK);
|
||||
entries.add(ModBlocks.RAW_NUGGET_BLOCK);
|
||||
entries.add(ModBlocks.NUGGET_ORE);
|
||||
entries.add(ModBlocks.NUGGET_DEEPSLATE_ORE);
|
||||
entries.add(ModBlocks.NUGGET_BLOCK.get());
|
||||
entries.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
entries.add(ModBlocks.NUGGET_ORE.get());
|
||||
entries.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
}).build());
|
||||
|
||||
public static final ItemGroup NUGGET_ITEMS_GROUP = Registry.register(Registries.ITEM_GROUP,
|
||||
Identifier.of(NuggetMod.MOD_ID, "nugget_items"),
|
||||
FabricItemGroup.builder().icon(() -> new ItemStack(ModItems.NUGGET))
|
||||
FabricItemGroup.builder().icon(() -> new ItemStack(ModItems.NUGGET.get()))
|
||||
.displayName(Text.translatable("creativetab.nuggetmod.nugget_items"))
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(ModItems.NUGGET);
|
||||
entries.add(ModItems.RAW_NUGGET);
|
||||
entries.add(ModItems.NUGGET.get());
|
||||
entries.add(ModItems.RAW_NUGGET.get());
|
||||
|
||||
// Tool Set
|
||||
entries.add(ModItems.NUGGET_SWORD);
|
||||
entries.add(ModItems.NUGGET_PICKAXE);
|
||||
entries.add(ModItems.NUGGET_AXE);
|
||||
entries.add(ModItems.NUGGET_SHOVEL);
|
||||
entries.add(ModItems.NUGGET_HOE);
|
||||
entries.add(ModItems.NUGGET_SWORD.get());
|
||||
entries.add(ModItems.NUGGET_PICKAXE.get());
|
||||
entries.add(ModItems.NUGGET_AXE.get());
|
||||
entries.add(ModItems.NUGGET_SHOVEL.get());
|
||||
entries.add(ModItems.NUGGET_HOE.get());
|
||||
entries.add(ModItems.NUGGET_SPEAR.get());
|
||||
|
||||
// Armor
|
||||
entries.add(ModItems.NUGGET_HELMET);
|
||||
entries.add(ModItems.NUGGET_CHESTPLATE);
|
||||
entries.add(ModItems.NUGGET_LEGGINGS);
|
||||
entries.add(ModItems.NUGGET_BOOTS);
|
||||
entries.add(ModItems.NUGGET_HELMET.get());
|
||||
entries.add(ModItems.NUGGET_CHESTPLATE.get());
|
||||
entries.add(ModItems.NUGGET_LEGGINGS.get());
|
||||
entries.add(ModItems.NUGGET_BOOTS.get());
|
||||
|
||||
entries.add(ModItems.NUGGET_HORSE_ARMOR);
|
||||
entries.add(ModItems.NUGGET_HORSE_ARMOR.get());
|
||||
|
||||
entries.add(ModItems.NUGGET_SMITHING_TEMPLATE);
|
||||
entries.add(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
|
||||
entries.add(ModItems.NUGGET_MUSIC_DISC);
|
||||
entries.add(ModItems.NUGGET_MUSIC_DISC.get());
|
||||
}).build());
|
||||
|
||||
public static void registerItemGroups() {
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.item;
|
||||
|
||||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.fabric.sound.ModSounds;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.equipment.EquipmentType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class ModItems {
|
||||
|
||||
public static final Item NUGGET = registerItem("nugget", setting -> new Item(setting
|
||||
.food(ModFoodComponents.NUGGET)));
|
||||
|
||||
public static final Item RAW_NUGGET = registerItem("raw_nugget", Item::new);
|
||||
|
||||
// Tools
|
||||
public static final Item NUGGET_SWORD = registerItem("nugget_sword",
|
||||
setting -> new Item(setting.sword(ModToolMaterials.NUGGET, 3.0F, -2.4F)));
|
||||
|
||||
public static final Item NUGGET_PICKAXE = registerItem("nugget_pickaxe",
|
||||
setting -> new Item(setting.pickaxe(ModToolMaterials.NUGGET, 1.0F, -2.8F)));
|
||||
|
||||
public static final Item NUGGET_SHOVEL = registerItem("nugget_shovel",
|
||||
settings -> new ShovelItem(ModToolMaterials.NUGGET, 1.5F, -3.0F, settings));
|
||||
|
||||
public static final Item NUGGET_AXE = registerItem("nugget_axe",
|
||||
settings -> new AxeItem(ModToolMaterials.NUGGET, 6.0F, -3.2F, settings));
|
||||
|
||||
public static final Item NUGGET_HOE = registerItem("nugget_hoe",
|
||||
settings -> new HoeItem(ModToolMaterials.NUGGET, -3.0F, 0.0F, settings));
|
||||
|
||||
public static final Item NUGGET_SPEAR = registerItem("nugget_spear",
|
||||
settings -> new Item(settings.spear(ModToolMaterials.NUGGET, 1F, 1.08F, 0.2F, 3.5F, 5.5F, 6.5F, 5.1F, 10.0F, 4.6F)));
|
||||
|
||||
// unreleased items
|
||||
// bow, crossbow, trident, shield , shears, flint and steel, fishing rod
|
||||
|
||||
// Armor
|
||||
public static final Item NUGGET_HELMET = registerItem("nugget_helmet",
|
||||
setting -> new Item(setting.armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.HELMET)));
|
||||
|
||||
public static final Item NUGGET_CHESTPLATE = registerItem("nugget_chestplate",
|
||||
setting -> new Item(setting.armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.CHESTPLATE)));
|
||||
|
||||
public static final Item NUGGET_LEGGINGS = registerItem("nugget_leggings",
|
||||
setting -> new Item(setting.armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.LEGGINGS)));
|
||||
|
||||
public static final Item NUGGET_BOOTS = registerItem("nugget_boots",
|
||||
setting -> new Item(setting.armor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, EquipmentType.BOOTS)));
|
||||
|
||||
public static final Item NUGGET_HORSE_ARMOR = registerItem("nugget_horse_armor",
|
||||
setting -> new Item(setting.horseArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL)));
|
||||
|
||||
public static final Item NUGGET_SMITHING_TEMPLATE = registerItem("nugget_armor_trim_smithing_template",
|
||||
SmithingTemplateItem::of);
|
||||
|
||||
public static final Item NUGGET_MUSIC_DISC = registerItem("nugget_music_disc",
|
||||
setting -> new Item(setting.jukeboxPlayable(ModSounds.NUGGET_THEME_KEY).maxCount(1)));
|
||||
|
||||
private static Item registerItem(String name, Function<Item.Settings, Item> function) {
|
||||
return Registry.register(Registries.ITEM, Identifier.of(NuggetMod.MOD_ID, name),
|
||||
function.apply(new Item.Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, Identifier.of(NuggetMod.MOD_ID, name)))));
|
||||
}
|
||||
|
||||
public static void registerModItems() {
|
||||
NuggetMod.LOGGER.info("Registering Mod Items for " + NuggetMod.MOD_ID);
|
||||
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(entries -> {
|
||||
entries.add(NUGGET);
|
||||
entries.add(RAW_NUGGET);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.sound;
|
||||
|
||||
import dev.sillyangel.nuggetmod.fabric.NuggetMod;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.sound.BlockSoundGroup;
|
||||
import net.minecraft.block.jukebox.JukeboxSong;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModSounds {
|
||||
|
||||
public static final SoundEvent NUGGET_THEME = registerSoundEvent("nugget_theme");
|
||||
public static final RegistryKey<JukeboxSong> NUGGET_THEME_KEY =
|
||||
RegistryKey.of(RegistryKeys.JUKEBOX_SONG, Identifier.of(NuggetMod.MOD_ID, "nugget_theme"));
|
||||
|
||||
private static SoundEvent registerSoundEvent(String name) {
|
||||
Identifier id = Identifier.of(NuggetMod.MOD_ID, name);
|
||||
return Registry.register(Registries.SOUND_EVENT, id, SoundEvent.of(id));
|
||||
}
|
||||
|
||||
public static void registerSounds() {
|
||||
NuggetMod.LOGGER.info("Registering Mod Sounds for " + NuggetMod.MOD_ID);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.world.gen;
|
||||
package dev.sillyangel.nuggetmod.fabric.world;
|
||||
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
|
||||
import dev.sillyangel.nuggetmod.fabric.world.ModPlacedFeatures;
|
||||
import dev.sillyangel.nuggetmod.worldgen.ModPlacedFeatures;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
|
||||
public class ModOreGeneration {
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.sillyangel.nuggetmod.fabric.world.gen;
|
||||
package dev.sillyangel.nuggetmod.fabric.world;
|
||||
|
||||
public class ModWorldGeneration {
|
||||
public static void generateModWorldGen() {
|
||||
@@ -1,13 +0,0 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge;
|
||||
|
||||
import net.neoforged.fml.common.Mod;
|
||||
|
||||
import dev.sillyangel.nuggetmod.ExampleMod;
|
||||
|
||||
@Mod(ExampleMod.MOD_ID)
|
||||
public final class ExampleModNeoForge {
|
||||
public ExampleModNeoForge() {
|
||||
// Run our common setup.
|
||||
ExampleMod.init();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge;
|
||||
|
||||
import dev.sillyangel.nuggetmod.neoforge.item.ModItemGroups;
|
||||
import dev.sillyangel.nuggetmod.neoforge.particle.ModParticles;
|
||||
import dev.sillyangel.nuggetmod.neoforge.villager.ModVillagers;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
|
||||
@Mod(dev.sillyangel.nuggetmod.NuggetMod.MOD_ID)
|
||||
public final class NuggetMod {
|
||||
public NuggetMod() {
|
||||
// Run our common setup.
|
||||
dev.sillyangel.nuggetmod.NuggetMod.init();
|
||||
|
||||
// Register NeoForge-specific features
|
||||
ModParticles.registerParticles();
|
||||
ModVillagers.registerVillagers();
|
||||
ModItemGroups.registerItemGroups();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge.client;
|
||||
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.neoforge.particle.ModParticles;
|
||||
import dev.sillyangel.nuggetmod.neoforge.particle.NuggetParticle;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
|
||||
|
||||
@EventBusSubscriber(modid = NuggetMod.MOD_ID, value = Dist.CLIENT)
|
||||
public class NuggetModClient {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerParticleFactories(RegisterParticleProvidersEvent event) {
|
||||
event.registerSpriteSet(ModParticles.NUGGET_PARTICLE, NuggetParticle.Factory::new);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge.item;
|
||||
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import dev.sillyangel.nuggetmod.block.ModBlocks;
|
||||
import dev.sillyangel.nuggetmod.item.ModItems;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModItemGroups {
|
||||
|
||||
public static final RegistryKey<ItemGroup> NUGGET_BLOCKS_GROUP_KEY = RegistryKey.of(RegistryKeys.ITEM_GROUP,
|
||||
Identifier.of(NuggetMod.MOD_ID, "nugget_blocks"));
|
||||
|
||||
public static final ItemGroup NUGGET_BLOCKS_GROUP = Registry.register(Registries.ITEM_GROUP,
|
||||
NUGGET_BLOCKS_GROUP_KEY,
|
||||
ItemGroup.create(ItemGroup.Row.TOP, -1)
|
||||
.icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK.get()))
|
||||
.displayName(Text.translatable("creativetab.nuggetmod.nugget_blocks"))
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(ModBlocks.NUGGET_BLOCK.get());
|
||||
entries.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
entries.add(ModBlocks.NUGGET_ORE.get());
|
||||
entries.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
}).build());
|
||||
|
||||
public static final RegistryKey<ItemGroup> NUGGET_ITEMS_GROUP_KEY = RegistryKey.of(RegistryKeys.ITEM_GROUP,
|
||||
Identifier.of(NuggetMod.MOD_ID, "nugget_items"));
|
||||
|
||||
public static final ItemGroup NUGGET_ITEMS_GROUP = Registry.register(Registries.ITEM_GROUP,
|
||||
NUGGET_ITEMS_GROUP_KEY,
|
||||
ItemGroup.create(ItemGroup.Row.TOP, -1)
|
||||
.icon(() -> new ItemStack(ModItems.NUGGET.get()))
|
||||
.displayName(Text.translatable("creativetab.nuggetmod.nugget_items"))
|
||||
.entries((displayContext, entries) -> {
|
||||
entries.add(ModItems.NUGGET.get());
|
||||
entries.add(ModItems.RAW_NUGGET.get());
|
||||
|
||||
entries.add(ModItems.NUGGET_SWORD.get());
|
||||
entries.add(ModItems.NUGGET_PICKAXE.get());
|
||||
entries.add(ModItems.NUGGET_AXE.get());
|
||||
entries.add(ModItems.NUGGET_SHOVEL.get());
|
||||
entries.add(ModItems.NUGGET_HOE.get());
|
||||
entries.add(ModItems.NUGGET_SPEAR.get());
|
||||
|
||||
entries.add(ModItems.NUGGET_HELMET.get());
|
||||
entries.add(ModItems.NUGGET_CHESTPLATE.get());
|
||||
entries.add(ModItems.NUGGET_LEGGINGS.get());
|
||||
entries.add(ModItems.NUGGET_BOOTS.get());
|
||||
|
||||
entries.add(ModItems.NUGGET_HORSE_ARMOR.get());
|
||||
entries.add(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
entries.add(ModItems.NUGGET_MUSIC_DISC.get());
|
||||
}).build());
|
||||
|
||||
public static void registerItemGroups() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge.particle;
|
||||
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import net.minecraft.particle.SimpleParticleType;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModParticles {
|
||||
public static final SimpleParticleType NUGGET_PARTICLE =
|
||||
registerParticle("nugget_particle", new SimpleParticleType(false));
|
||||
|
||||
private static SimpleParticleType registerParticle(String name, SimpleParticleType particleType) {
|
||||
return Registry.register(Registries.PARTICLE_TYPE, Identifier.of(NuggetMod.MOD_ID, name), particleType);
|
||||
}
|
||||
|
||||
public static void registerParticles() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge.particle;
|
||||
|
||||
import net.minecraft.client.particle.*;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.particle.SimpleParticleType;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class NuggetParticle extends BillboardParticle {
|
||||
public NuggetParticle(ClientWorld clientWorld, double x, double y, double z,
|
||||
SpriteProvider spriteProvider, double xSpeed, double ySpeed, double zSpeed) {
|
||||
super(clientWorld, x, y, z, xSpeed, ySpeed, zSpeed, spriteProvider.getFirst());
|
||||
|
||||
this.velocityMultiplier = 0.8f;
|
||||
this.maxAge = 40;
|
||||
this.red = 1f;
|
||||
this.green = 1f;
|
||||
this.blue = 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RenderType getRenderType() {
|
||||
return RenderType.PARTICLE_ATLAS_TRANSLUCENT;
|
||||
}
|
||||
|
||||
public static class Factory implements ParticleFactory<SimpleParticleType> {
|
||||
private final SpriteProvider spriteProvider;
|
||||
|
||||
public Factory(SpriteProvider spriteProvider) {
|
||||
this.spriteProvider = spriteProvider;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Particle createParticle(SimpleParticleType parameters, ClientWorld world, double x, double y, double z,
|
||||
double velocityX, double velocityY, double velocityZ, Random random) {
|
||||
return new NuggetParticle(world, x, y, z, this.spriteProvider, velocityX, velocityY, velocityZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package dev.sillyangel.nuggetmod.neoforge.villager;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import dev.sillyangel.nuggetmod.NuggetMod;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.sound.SoundEvents;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
import net.minecraft.world.poi.PointOfInterestType;
|
||||
|
||||
public class ModVillagers {
|
||||
public static final RegistryKey<PointOfInterestType> NUGGETER_POI_KEY = registerPoiKey("nuggeter_poi");
|
||||
|
||||
public static final RegistryKey<VillagerProfession> NUGGETER_KEY =
|
||||
RegistryKey.of(RegistryKeys.VILLAGER_PROFESSION, Identifier.of(NuggetMod.MOD_ID, "nuggeter"));
|
||||
|
||||
public static final VillagerProfession NUGGETER = registerProfession("nuggeter", NUGGETER_POI_KEY);
|
||||
|
||||
private static VillagerProfession registerProfession(String name, RegistryKey<PointOfInterestType> type) {
|
||||
return Registry.register(Registries.VILLAGER_PROFESSION, Identifier.of(NuggetMod.MOD_ID, name),
|
||||
new VillagerProfession(Text.literal("Nuggeter"), entry -> entry.matchesKey(type), entry -> entry.matchesKey(type),
|
||||
ImmutableSet.of(), ImmutableSet.of(), SoundEvents.ENTITY_VILLAGER_WORK_LIBRARIAN));
|
||||
}
|
||||
|
||||
private static RegistryKey<PointOfInterestType> registerPoiKey(String name) {
|
||||
return RegistryKey.of(RegistryKeys.POINT_OF_INTEREST_TYPE, Identifier.of(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
|
||||
public static void registerVillagers() {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user