1.21.11 first part
This commit is contained in:
37
src/main/java/dev/sillyangel/nugget/Config.java
Normal file
37
src/main/java/dev/sillyangel/nugget/Config.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package dev.sillyangel.nugget;
|
||||
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.config.ModConfigEvent;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
|
||||
// Demonstrates how to use Forge's config APIs
|
||||
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class Config
|
||||
{
|
||||
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
||||
|
||||
static final ForgeConfigSpec SPEC = BUILDER.build();
|
||||
|
||||
public static boolean logDirtBlock;
|
||||
public static Set<Item> items;
|
||||
|
||||
private static boolean validateItemName(final Object obj)
|
||||
{
|
||||
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(Identifier.tryParse(itemName));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
static void onLoad(final ModConfigEvent event)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,73 +1,66 @@
|
||||
package xyz.sillyangel.nugget;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
||||
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.slf4j.Logger;
|
||||
import xyz.sillyangel.nugget.item.ModCreativeModeTabs;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import xyz.sillyangel.nugget.sound.ModSounds;
|
||||
|
||||
// Very important Comment
|
||||
// The value here should match an entry in the META-INF/mods.toml file
|
||||
@Mod(NuggetMod.MOD_ID)
|
||||
public class NuggetMod {
|
||||
// Define mod id in a common place for everything to reference
|
||||
public static final String MOD_ID = "nuggetmod";
|
||||
// Directly reference a slf4j logger
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public NuggetMod() {
|
||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
ModCreativeModeTabs.register(modEventBus);
|
||||
|
||||
ModItems.register(modEventBus);
|
||||
ModBlocks.register(modEventBus);
|
||||
|
||||
ModSounds.register(modEventBus);
|
||||
|
||||
// Register the item to a creative tab
|
||||
modEventBus.addListener(this::addCreative);
|
||||
// Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
|
||||
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// Add the example block item to the building blocks tab
|
||||
private void addCreative(BuildCreativeModeTabContentsEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// You can use SubscribeEvent and let the Event Bus discover methods to call
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(ServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
|
||||
@Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||
public static class ClientModEvents {
|
||||
@SubscribeEvent
|
||||
public static void onClientSetup(FMLClientSetupEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
package dev.sillyangel.nugget;
|
||||
|
||||
import com.mojang.logging.LogUtils;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
|
||||
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.slf4j.Logger;
|
||||
import dev.sillyangel.nugget.item.ModCreativeModeTabs;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
import dev.sillyangel.nugget.sound.ModSounds;
|
||||
|
||||
// Very important Comment
|
||||
// The value here should match an entry in the META-INF/mods.toml file
|
||||
@Mod(NuggetMod.MOD_ID)
|
||||
public class NuggetMod {
|
||||
// Define mod id in a common place for everything to reference
|
||||
public static final String MOD_ID = "nuggetmod";
|
||||
// Directly reference a slf4j logger
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public NuggetMod(FMLJavaModLoadingContext context) {
|
||||
var modBusGroup = context.getModBusGroup();
|
||||
|
||||
// Register the commonSetup method for modloading
|
||||
FMLCommonSetupEvent.getBus(modBusGroup).addListener(this::commonSetup);
|
||||
|
||||
// Register the Deferred Register to the mod event bus so blocks get registered
|
||||
ModBlocks.register(modBusGroup);
|
||||
// Register the Deferred Register to the mod event bus so items get registered
|
||||
ModItems.register(modBusGroup);
|
||||
// Register the Deferred Register to the mod event bus so tabs get registered
|
||||
ModCreativeModeTabs.register(modBusGroup);
|
||||
// Register the Deferred Register to the mod event bus so sounds get registered
|
||||
ModSounds.register(modBusGroup);
|
||||
|
||||
// Register the item to a creative tab
|
||||
BuildCreativeModeTabContentsEvent.BUS.addListener(this::addCreative);
|
||||
|
||||
// Register our mod's ForgeConfigSpec so that Forge can create and load the config file for us
|
||||
context.registerConfig(ModConfig.Type.COMMON, Config.SPEC);
|
||||
}
|
||||
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// Add the example block item to the building blocks tab
|
||||
private void addCreative(BuildCreativeModeTabContentsEvent event) {
|
||||
|
||||
}
|
||||
|
||||
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
|
||||
@Mod.EventBusSubscriber(modid = MOD_ID, value = Dist.CLIENT)
|
||||
public static class ClientModEvents {
|
||||
@SubscribeEvent
|
||||
public static void onClientSetup(FMLClientSetupEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +1,60 @@
|
||||
package xyz.sillyangel.nugget.block;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.util.valueproviders.UniformInt;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.DropExperienceBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModBlocks {
|
||||
public static final DeferredRegister<Block> BLOCKS =
|
||||
DeferredRegister.create(ForgeRegistries.BLOCKS, NuggetMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Block> NUGGET_BLOCK = registerBlock("nugget_block",
|
||||
() -> new Block(BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_block")))
|
||||
.strength(4f).requiresCorrectToolForDrops().sound(SoundType.AMETHYST)));
|
||||
|
||||
public static final RegistryObject<Block> RAW_NUGGET_BLOCK = registerBlock("raw_nugget_block",
|
||||
() -> new Block(BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget_block")))
|
||||
.strength(3f).requiresCorrectToolForDrops()));
|
||||
// ores
|
||||
public static final RegistryObject<Block> NUGGET_ORE = registerBlock("nugget_ore",
|
||||
() -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_ore")))
|
||||
.strength(4f).requiresCorrectToolForDrops()));
|
||||
|
||||
public static final RegistryObject<Block> NUGGET_DEEPSLATE_ORE = registerBlock("nugget_deepslate_ore",
|
||||
() -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_deepslate_ore")))
|
||||
.strength(5f).requiresCorrectToolForDrops().sound(SoundType.DEEPSLATE)));
|
||||
|
||||
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) {
|
||||
RegistryObject<T> toReturn = BLOCKS.register(name, block);
|
||||
registerBlockItem(name, toReturn);
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) {
|
||||
ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)))));
|
||||
}
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
BLOCKS.register(eventBus);
|
||||
}
|
||||
package dev.sillyangel.nugget.block;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.util.valueproviders.UniformInt;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.DropExperienceBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraftforge.eventbus.api.bus.BusGroup;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModBlocks {
|
||||
public static final DeferredRegister<Block> BLOCKS =
|
||||
DeferredRegister.create(ForgeRegistries.BLOCKS, NuggetMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Block> NUGGET_BLOCK = registerBlock("nugget_block",
|
||||
() -> new Block(BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_block")))
|
||||
.strength(4f).requiresCorrectToolForDrops().sound(SoundType.AMETHYST)));
|
||||
|
||||
public static final RegistryObject<Block> RAW_NUGGET_BLOCK = registerBlock("raw_nugget_block",
|
||||
() -> new Block(BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget_block")))
|
||||
.strength(3f).requiresCorrectToolForDrops()));
|
||||
// ores
|
||||
public static final RegistryObject<Block> NUGGET_ORE = registerBlock("nugget_ore",
|
||||
() -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_ore")))
|
||||
.strength(4f).requiresCorrectToolForDrops()));
|
||||
|
||||
public static final RegistryObject<Block> NUGGET_DEEPSLATE_ORE = registerBlock("nugget_deepslate_ore",
|
||||
() -> new DropExperienceBlock(UniformInt.of(2, 4), BlockBehaviour.Properties.of()
|
||||
.setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_deepslate_ore")))
|
||||
.strength(5f).requiresCorrectToolForDrops().sound(SoundType.DEEPSLATE)));
|
||||
|
||||
private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) {
|
||||
RegistryObject<T> toReturn = BLOCKS.register(name, block);
|
||||
registerBlockItem(name, toReturn);
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) {
|
||||
ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name)))));
|
||||
}
|
||||
|
||||
public static void register(BusGroup busGroup) {
|
||||
BLOCKS.register(busGroup);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,41 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.loot.LootTableProvider;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraftforge.common.data.BlockTagsProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.data.event.GatherDataEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class DataGenerators {
|
||||
@SubscribeEvent
|
||||
public static void gatherData(GatherDataEvent event) {
|
||||
DataGenerator generator = event.getGenerator();
|
||||
PackOutput packOutput = generator.getPackOutput();
|
||||
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
|
||||
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
|
||||
|
||||
generator.addProvider(event.includeServer(), new LootTableProvider(packOutput, Collections.emptySet(),
|
||||
List.of(new LootTableProvider.SubProviderEntry(ModBlockLootTableProvider::new, LootContextParamSets.BLOCK)), lookupProvider));
|
||||
generator.addProvider(event.includeServer(), new ModRecipeProvider.Runner(packOutput, lookupProvider));
|
||||
|
||||
BlockTagsProvider blockTagsProvider = new ModBlockTagProvider(packOutput, lookupProvider, existingFileHelper);
|
||||
generator.addProvider(event.includeServer(), blockTagsProvider);
|
||||
generator.addProvider(event.includeServer(), new ModItemTagProvider(packOutput, lookupProvider, blockTagsProvider.contentsGetter(), existingFileHelper));
|
||||
|
||||
generator.addProvider(event.includeClient(), new ModItemModelProvider(packOutput, existingFileHelper));
|
||||
generator.addProvider(event.includeClient(), new ModBlockStateProvider(packOutput, existingFileHelper));
|
||||
|
||||
generator.addProvider(event.includeServer(), new ModDatapackEntries(packOutput, lookupProvider));
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.loot.LootTableProvider;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
|
||||
import net.minecraftforge.common.data.BlockTagsProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.data.event.GatherDataEvent;
|
||||
import net.minecraftforge.eventbus.api.listener.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class DataGenerators {
|
||||
@SubscribeEvent
|
||||
public static void gatherData(GatherDataEvent event) {
|
||||
DataGenerator generator = event.getGenerator();
|
||||
PackOutput packOutput = generator.getPackOutput();
|
||||
ExistingFileHelper existingFileHelper = event.getExistingFileHelper();
|
||||
CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider();
|
||||
|
||||
generator.addProvider(event.includeServer(), new LootTableProvider(packOutput, Collections.emptySet(),
|
||||
List.of(new LootTableProvider.SubProviderEntry(ModBlockLootTableProvider::new, LootContextParamSets.BLOCK)), lookupProvider));
|
||||
generator.addProvider(event.includeServer(), new ModRecipeProvider.Runner(packOutput, lookupProvider));
|
||||
|
||||
BlockTagsProvider blockTagsProvider = new ModBlockTagProvider(packOutput, lookupProvider, existingFileHelper);
|
||||
generator.addProvider(event.includeServer(), blockTagsProvider);
|
||||
generator.addProvider(event.includeServer(), new ModItemTagProvider(packOutput, lookupProvider, blockTagsProvider.contentsGetter(), existingFileHelper));
|
||||
|
||||
generator.addProvider(event.includeClient(), new ModItemModelProvider(packOutput, existingFileHelper));
|
||||
generator.addProvider(event.includeClient(), new ModBlockStateProvider(packOutput, existingFileHelper));
|
||||
|
||||
generator.addProvider(event.includeServer(), new ModDatapackEntries(packOutput, lookupProvider));
|
||||
}
|
||||
}
|
||||
@@ -1,55 +1,53 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.loot.BlockLootSubProvider;
|
||||
import net.minecraft.world.flag.FeatureFlags;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.storage.loot.LootTable;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootPoolEntryContainer;
|
||||
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
|
||||
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ModBlockLootTableProvider extends BlockLootSubProvider {
|
||||
protected ModBlockLootTableProvider(HolderLookup.Provider pRegistries) {
|
||||
super(Set.of(), FeatureFlags.REGISTRY.allFlags(), pRegistries);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generate() {
|
||||
dropSelf(ModBlocks.NUGGET_BLOCK.get());
|
||||
dropSelf(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
this.add(ModBlocks.NUGGET_ORE.get(),
|
||||
block -> createOreDrop(ModBlocks.NUGGET_ORE.get(), ModItems.RAW_NUGGET.get()));
|
||||
this.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get(),
|
||||
block -> createMultipleOreDrops(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), ModItems.RAW_NUGGET.get(), 2, 6));
|
||||
}
|
||||
|
||||
protected LootTable.Builder createMultipleOreDrops(Block pBlock, Item item, float minDrops, float maxDrops) {
|
||||
HolderLookup.RegistryLookup<Enchantment> registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT);
|
||||
return this.createSilkTouchDispatchTable(
|
||||
pBlock, this.applyExplosionDecay(
|
||||
pBlock, LootItem.lootTableItem(item)
|
||||
.apply(SetItemCountFunction.setCount(UniformGenerator.between(minDrops, maxDrops)))
|
||||
.apply(ApplyBonusCount.addOreBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<Block> getKnownBlocks() {
|
||||
return ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator;
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.loot.BlockLootSubProvider;
|
||||
import net.minecraft.world.flag.FeatureFlags;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.enchantment.Enchantment;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.storage.loot.LootTable;
|
||||
import net.minecraft.world.level.storage.loot.entries.LootItem;
|
||||
import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount;
|
||||
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
|
||||
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class ModBlockLootTableProvider extends BlockLootSubProvider {
|
||||
protected ModBlockLootTableProvider(HolderLookup.Provider pRegistries) {
|
||||
super(Set.of(), FeatureFlags.REGISTRY.allFlags(), pRegistries);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generate() {
|
||||
dropSelf(ModBlocks.NUGGET_BLOCK.get());
|
||||
dropSelf(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
this.add(ModBlocks.NUGGET_ORE.get(),
|
||||
block -> createOreDrop(ModBlocks.NUGGET_ORE.get(), ModItems.RAW_NUGGET.get()));
|
||||
this.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get(),
|
||||
block -> createMultipleOreDrops(ModBlocks.NUGGET_DEEPSLATE_ORE.get(), ModItems.RAW_NUGGET.get(), 2, 6));
|
||||
}
|
||||
|
||||
protected LootTable.Builder createMultipleOreDrops(Block pBlock, Item item, float minDrops, float maxDrops) {
|
||||
HolderLookup.RegistryLookup<Enchantment> registrylookup = this.registries.lookupOrThrow(Registries.ENCHANTMENT);
|
||||
return this.createSilkTouchDispatchTable(
|
||||
pBlock, this.applyExplosionDecay(
|
||||
pBlock, LootItem.lootTableItem(item)
|
||||
.apply(SetItemCountFunction.setCount(UniformGenerator.between(minDrops, maxDrops)))
|
||||
.apply(ApplyBonusCount.addOreBonusCount(registrylookup.getOrThrow(Enchantments.FORTUNE)))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Iterable<Block> getKnownBlocks() {
|
||||
return ModBlocks.BLOCKS.getEntries().stream().map(RegistryObject::get)::iterator;
|
||||
}
|
||||
}
|
||||
@@ -1,29 +1,29 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.BlockStateProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ModBlockStateProvider extends BlockStateProvider {
|
||||
public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
|
||||
super(output, NuggetMod.MOD_ID, exFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerStatesAndModels() {
|
||||
blockWithItem(ModBlocks.NUGGET_BLOCK);
|
||||
blockWithItem(ModBlocks.RAW_NUGGET_BLOCK);
|
||||
|
||||
blockWithItem(ModBlocks.NUGGET_ORE);
|
||||
blockWithItem(ModBlocks.NUGGET_DEEPSLATE_ORE);
|
||||
|
||||
}
|
||||
|
||||
private void blockWithItem(RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get()));
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.BlockStateProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
public class ModBlockStateProvider extends BlockStateProvider {
|
||||
public ModBlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) {
|
||||
super(output, NuggetMod.MOD_ID, exFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerStatesAndModels() {
|
||||
blockWithItem(ModBlocks.NUGGET_BLOCK);
|
||||
blockWithItem(ModBlocks.RAW_NUGGET_BLOCK);
|
||||
|
||||
blockWithItem(ModBlocks.NUGGET_ORE);
|
||||
blockWithItem(ModBlocks.NUGGET_DEEPSLATE_ORE);
|
||||
|
||||
}
|
||||
|
||||
private void blockWithItem(RegistryObject<Block> blockRegistryObject) {
|
||||
simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get()));
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,41 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraftforge.common.data.BlockTagsProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import xyz.sillyangel.nugget.util.ModTags;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModBlockTagProvider extends BlockTagsProvider {
|
||||
public ModBlockTagProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper existingFileHelper) {
|
||||
super(output, lookupProvider, NuggetMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTags(HolderLookup.Provider pProvider) {
|
||||
tag(BlockTags.MINEABLE_WITH_PICKAXE)
|
||||
.add(ModBlocks.NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.NUGGET_ORE.get())
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
tag(BlockTags.NEEDS_STONE_TOOL)
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get())
|
||||
.add(ModBlocks.NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
tag(ModTags.Blocks.NEEDS_NUGGET_TOOL)
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.addTag(BlockTags.NEEDS_DIAMOND_TOOL);
|
||||
|
||||
tag(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL)
|
||||
.addTag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL)
|
||||
.remove(ModTags.Blocks.NEEDS_NUGGET_TOOL);
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraftforge.common.data.BlockTagsProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import dev.sillyangel.nugget.util.ModTags;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModBlockTagProvider extends BlockTagsProvider {
|
||||
public ModBlockTagProvider(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper existingFileHelper) {
|
||||
super(output, lookupProvider, NuggetMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTags(HolderLookup.Provider pProvider) {
|
||||
tag(BlockTags.MINEABLE_WITH_PICKAXE)
|
||||
.add(ModBlocks.NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.NUGGET_ORE.get())
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
tag(BlockTags.NEEDS_STONE_TOOL)
|
||||
.add(ModBlocks.NUGGET_DEEPSLATE_ORE.get())
|
||||
.add(ModBlocks.NUGGET_BLOCK.get())
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
|
||||
tag(ModTags.Blocks.NEEDS_NUGGET_TOOL)
|
||||
.add(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.addTag(BlockTags.NEEDS_DIAMOND_TOOL);
|
||||
|
||||
tag(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL)
|
||||
.addTag(BlockTags.INCORRECT_FOR_DIAMOND_TOOL)
|
||||
.remove(ModTags.Blocks.NEEDS_NUGGET_TOOL);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.trim.ModTrimMaterials;
|
||||
import xyz.sillyangel.nugget.trim.ModTrimPatterns;
|
||||
import xyz.sillyangel.nugget.worldgen.ModBiomeModifiers;
|
||||
import xyz.sillyangel.nugget.worldgen.ModConfiguredFeatures;
|
||||
import xyz.sillyangel.nugget.worldgen.ModPlacedFeatures;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.trim.ModTrimMaterials;
|
||||
import dev.sillyangel.nugget.trim.ModTrimPatterns;
|
||||
import dev.sillyangel.nugget.worldgen.ModBiomeModifiers;
|
||||
import dev.sillyangel.nugget.worldgen.ModConfiguredFeatures;
|
||||
import dev.sillyangel.nugget.worldgen.ModPlacedFeatures;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.core.RegistrySetBuilder;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
@@ -1,134 +1,134 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import net.minecraft.world.item.equipment.trim.TrimMaterial;
|
||||
import net.minecraft.world.item.equipment.trim.TrimMaterials;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.ItemModelBuilder;
|
||||
import net.minecraftforge.client.model.generators.ItemModelProvider;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraftforge.client.model.generators.ModelFile;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public class ModItemModelProvider extends ItemModelProvider {
|
||||
private static LinkedHashMap<ResourceKey<TrimMaterial>, Float> trimMaterials = new LinkedHashMap<>();
|
||||
static {
|
||||
trimMaterials.put(TrimMaterials.QUARTZ, 0.1F);
|
||||
trimMaterials.put(TrimMaterials.IRON, 0.2F);
|
||||
trimMaterials.put(TrimMaterials.NETHERITE, 0.3F);
|
||||
trimMaterials.put(TrimMaterials.REDSTONE, 0.4F);
|
||||
trimMaterials.put(TrimMaterials.COPPER, 0.5F);
|
||||
trimMaterials.put(TrimMaterials.GOLD, 0.6F);
|
||||
trimMaterials.put(TrimMaterials.EMERALD, 0.7F);
|
||||
trimMaterials.put(TrimMaterials.DIAMOND, 0.8F);
|
||||
trimMaterials.put(TrimMaterials.LAPIS, 0.9F);
|
||||
trimMaterials.put(TrimMaterials.AMETHYST, 1.0F);
|
||||
}
|
||||
|
||||
public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
|
||||
super(output, NuggetMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerModels() {
|
||||
basicItem(ModItems.NUGGET_HORSE_ARMOR.get());
|
||||
basicItem(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
basicItem(ModItems.NUGGET.get());
|
||||
basicItem(ModItems.RAW_NUGGET.get());
|
||||
basicItem(ModItems.NUGGET_MUSIC_DISC.get());
|
||||
|
||||
handheldItem(ModItems.NUGGET_SWORD);
|
||||
handheldItem(ModItems.NUGGET_PICKAXE);
|
||||
handheldItem(ModItems.NUGGET_SHOVEL);
|
||||
handheldItem(ModItems.NUGGET_AXE);
|
||||
handheldItem(ModItems.NUGGET_HOE);
|
||||
|
||||
trimmedArmorItem(ModItems.NUGGET_HELMET);
|
||||
trimmedArmorItem(ModItems.NUGGET_CHESTPLATE);
|
||||
trimmedArmorItem(ModItems.NUGGET_LEGGINGS);
|
||||
trimmedArmorItem(ModItems.NUGGET_BOOTS);
|
||||
}
|
||||
private void trimmedArmorItem(RegistryObject<Item> itemRegistryObject) {
|
||||
final String MOD_ID = NuggetMod.MOD_ID; // Change this to your mod id
|
||||
if (itemRegistryObject.get() instanceof ArmorItem armorItem) {
|
||||
trimMaterials.forEach((trimMaterial, value) -> {
|
||||
float trimValue = value;
|
||||
|
||||
String armorType = "";
|
||||
if(armorItem.toString().contains("helmet")) {
|
||||
armorType = "helmet";
|
||||
} else if(armorItem.toString().contains("chestplate")) {
|
||||
armorType = "chestplate";
|
||||
} else if(armorItem.toString().contains("leggings")) {
|
||||
armorType = "leggings";
|
||||
} else if(armorItem.toString().contains("boots")) {
|
||||
armorType = "boots";
|
||||
}
|
||||
|
||||
|
||||
String armorItemPath = armorItem.toString();
|
||||
String trimPath = "trims/items/" + armorType + "_trim_" + trimMaterial.location().getPath();
|
||||
String currentTrimName = armorItemPath + "_" + trimMaterial.location().getPath() + "_trim";
|
||||
ResourceLocation armorItemResLoc = ResourceLocation.parse(armorItemPath);
|
||||
ResourceLocation trimResLoc = ResourceLocation.parse(trimPath); // minecraft namespace
|
||||
ResourceLocation trimNameResLoc = ResourceLocation.parse(currentTrimName);
|
||||
// This is used for making the ExistingFileHelper acknowledge that this texture exist, so this will
|
||||
// avoid an IllegalArgumentException
|
||||
existingFileHelper.trackGenerated(trimResLoc, PackType.CLIENT_RESOURCES, ".png", "textures");
|
||||
// Trimmed armorItem files
|
||||
getBuilder(currentTrimName)
|
||||
.parent(new ModelFile.UncheckedModelFile("item/generated"))
|
||||
.texture("layer0", armorItemResLoc.getNamespace() + ":item/" + armorItemResLoc.getPath())
|
||||
.texture("layer1", trimResLoc);
|
||||
// Non-trimmed armorItem file (normal variant)
|
||||
this.withExistingParent(itemRegistryObject.getId().getPath(),
|
||||
mcLoc("item/generated"))
|
||||
.override()
|
||||
.model(new ModelFile.UncheckedModelFile(trimNameResLoc.getNamespace() + ":item/" + trimNameResLoc.getPath()))
|
||||
.predicate(mcLoc("trim_type"), trimValue).end()
|
||||
.texture("layer0",
|
||||
ResourceLocation.fromNamespaceAndPath(MOD_ID,
|
||||
"item/" + itemRegistryObject.getId().getPath()));
|
||||
});
|
||||
}
|
||||
}
|
||||
private ItemModelBuilder handheldItem(RegistryObject<Item> item) {
|
||||
return withExistingParent(item.getId().getPath(),
|
||||
ResourceLocation.parse("item/handheld")).texture("layer0",
|
||||
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
|
||||
public void buttonItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/button_inventory"))
|
||||
.texture("texture", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
public void fenceItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/fence_inventory"))
|
||||
.texture("texture", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
public void wallItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/wall_inventory"))
|
||||
.texture("wall", ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
private ItemModelBuilder simpleBlockItem(RegistryObject<? extends Block> item) {
|
||||
return withExistingParent(item.getId().getPath(),
|
||||
ResourceLocation.parse("item/generated")).texture("layer0",
|
||||
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.world.item.ArmorItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.equipment.trim.TrimMaterial;
|
||||
import net.minecraft.world.item.equipment.trim.TrimMaterials;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.client.model.generators.ItemModelBuilder;
|
||||
import net.minecraftforge.client.model.generators.ItemModelProvider;
|
||||
import net.minecraftforge.client.model.generators.ModelFile;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public class ModItemModelProvider extends ItemModelProvider {
|
||||
private static LinkedHashMap<ResourceKey<TrimMaterial>, Float> trimMaterials = new LinkedHashMap<>();
|
||||
static {
|
||||
trimMaterials.put(TrimMaterials.QUARTZ, 0.1F);
|
||||
trimMaterials.put(TrimMaterials.IRON, 0.2F);
|
||||
trimMaterials.put(TrimMaterials.NETHERITE, 0.3F);
|
||||
trimMaterials.put(TrimMaterials.REDSTONE, 0.4F);
|
||||
trimMaterials.put(TrimMaterials.COPPER, 0.5F);
|
||||
trimMaterials.put(TrimMaterials.GOLD, 0.6F);
|
||||
trimMaterials.put(TrimMaterials.EMERALD, 0.7F);
|
||||
trimMaterials.put(TrimMaterials.DIAMOND, 0.8F);
|
||||
trimMaterials.put(TrimMaterials.LAPIS, 0.9F);
|
||||
trimMaterials.put(TrimMaterials.AMETHYST, 1.0F);
|
||||
}
|
||||
|
||||
public ModItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) {
|
||||
super(output, NuggetMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerModels() {
|
||||
basicItem(ModItems.NUGGET_HORSE_ARMOR.get());
|
||||
basicItem(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
basicItem(ModItems.NUGGET.get());
|
||||
basicItem(ModItems.RAW_NUGGET.get());
|
||||
basicItem(ModItems.NUGGET_MUSIC_DISC.get());
|
||||
|
||||
handheldItem(ModItems.NUGGET_SWORD);
|
||||
handheldItem(ModItems.NUGGET_PICKAXE);
|
||||
handheldItem(ModItems.NUGGET_SHOVEL);
|
||||
handheldItem(ModItems.NUGGET_AXE);
|
||||
handheldItem(ModItems.NUGGET_HOE);
|
||||
|
||||
trimmedArmorItem(ModItems.NUGGET_HELMET);
|
||||
trimmedArmorItem(ModItems.NUGGET_CHESTPLATE);
|
||||
trimmedArmorItem(ModItems.NUGGET_LEGGINGS);
|
||||
trimmedArmorItem(ModItems.NUGGET_BOOTS);
|
||||
}
|
||||
private void trimmedArmorItem(RegistryObject<Item> itemRegistryObject) {
|
||||
final String MOD_ID = NuggetMod.MOD_ID; // Change this to your mod id
|
||||
if (itemRegistryObject.get() instanceof ArmorItem armorItem) {
|
||||
trimMaterials.forEach((trimMaterial, value) -> {
|
||||
float trimValue = value;
|
||||
|
||||
String armorType = "";
|
||||
if(armorItem.toString().contains("helmet")) {
|
||||
armorType = "helmet";
|
||||
} else if(armorItem.toString().contains("chestplate")) {
|
||||
armorType = "chestplate";
|
||||
} else if(armorItem.toString().contains("leggings")) {
|
||||
armorType = "leggings";
|
||||
} else if(armorItem.toString().contains("boots")) {
|
||||
armorType = "boots";
|
||||
}
|
||||
|
||||
|
||||
String armorItemPath = armorItem.toString();
|
||||
String trimPath = "trims/items/" + armorType + "_trim_" + trimMaterial.location().getPath();
|
||||
String currentTrimName = armorItemPath + "_" + trimMaterial.location().getPath() + "_trim";
|
||||
Identifier armorItemResLoc = Identifier.parse(armorItemPath);
|
||||
Identifier trimResLoc = Identifier.parse(trimPath); // minecraft namespace
|
||||
Identifier trimNameResLoc = Identifier.parse(currentTrimName);
|
||||
// This is used for making the ExistingFileHelper acknowledge that this texture exist, so this will
|
||||
// avoid an IllegalArgumentException
|
||||
existingFileHelper.trackGenerated(trimResLoc, PackType.CLIENT_RESOURCES, ".png", "textures");
|
||||
// Trimmed armorItem files
|
||||
getBuilder(currentTrimName)
|
||||
.parent(new ModelFile.UncheckedModelFile("item/generated"))
|
||||
.texture("layer0", armorItemResLoc.getNamespace() + ":item/" + armorItemResLoc.getPath())
|
||||
.texture("layer1", trimResLoc);
|
||||
// Non-trimmed armorItem file (normal variant)
|
||||
this.withExistingParent(itemRegistryObject.getId().getPath(),
|
||||
mcLoc("item/generated"))
|
||||
.override()
|
||||
.model(new ModelFile.UncheckedModelFile(trimNameResLoc.getNamespace() + ":item/" + trimNameResLoc.getPath()))
|
||||
.predicate(mcLoc("trim_type"), trimValue).end()
|
||||
.texture("layer0",
|
||||
Identifier.fromNamespaceAndPath(MOD_ID,
|
||||
"item/" + itemRegistryObject.getId().getPath()));
|
||||
});
|
||||
}
|
||||
}
|
||||
private ItemModelBuilder handheldItem(RegistryObject<Item> item) {
|
||||
return withExistingParent(item.getId().getPath(),
|
||||
Identifier.parse("item/handheld")).texture("layer0",
|
||||
Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
|
||||
public void buttonItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/button_inventory"))
|
||||
.texture("texture", Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
public void fenceItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/fence_inventory"))
|
||||
.texture("texture", Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
public void wallItem(RegistryObject<? extends Block> block, RegistryObject<Block> baseBlock) {
|
||||
this.withExistingParent(ForgeRegistries.BLOCKS.getKey(block.get()).getPath(), mcLoc("block/wall_inventory"))
|
||||
.texture("wall", Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,
|
||||
"block/" + ForgeRegistries.BLOCKS.getKey(baseBlock.get()).getPath()));
|
||||
}
|
||||
|
||||
private ItemModelBuilder simpleBlockItem(RegistryObject<? extends Block> item) {
|
||||
return withExistingParent(item.getId().getPath(),
|
||||
Identifier.parse("item/generated")).texture("layer0",
|
||||
Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID,"item/" + item.getId().getPath()));
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,43 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import xyz.sillyangel.nugget.util.ModTags;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.tags.ItemTagsProvider;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModItemTagProvider extends ItemTagsProvider {
|
||||
public ModItemTagProvider(PackOutput packOutput, CompletableFuture<HolderLookup.Provider> completableFuture,
|
||||
CompletableFuture<TagLookup<Block>> lookupCompletableFuture, @Nullable ExistingFileHelper existingFileHelper) {
|
||||
super(packOutput, completableFuture, lookupCompletableFuture, NuggetMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTags(HolderLookup.Provider pProvider) {
|
||||
tag(ModTags.Items.TRANSFORMABLE_ITEMS)
|
||||
.add(ModItems.NUGGET.get())
|
||||
.add(ModItems.RAW_NUGGET.get())
|
||||
.add(Items.COAL)
|
||||
.add(Items.STICK)
|
||||
.add(Items.COMPASS);
|
||||
|
||||
tag(ItemTags.TRIMMABLE_ARMOR)
|
||||
.add(ModItems.NUGGET_HELMET.get())
|
||||
.add(ModItems.NUGGET_CHESTPLATE.get())
|
||||
.add(ModItems.NUGGET_LEGGINGS.get())
|
||||
.add(ModItems.NUGGET_BOOTS.get());
|
||||
tag(ItemTags.TRIM_MATERIALS)
|
||||
.add(ModItems.NUGGET.get());
|
||||
tag(ItemTags.TRIM_TEMPLATES)
|
||||
.add(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
tag(ModTags.Items.NUGGET_REPAIRS)
|
||||
.add(ModItems.NUGGET.get());
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import dev.sillyangel.nugget.util.ModTags;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.tags.ItemTagProvider;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModItemTagProvider extends ItemTagsProvider {
|
||||
public ModItemTagProvider(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pLookupProvider, CompletableFuture<TagLookup<Block>> pBlockTags, @Nullable ExistingFileHelper existingFileHelper) {
|
||||
super(pOutput, pLookupProvider, pBlockTags, NuggetMod.MOD_ID, existingFileHelper);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTags(HolderLookup.Provider pProvider) {
|
||||
tag(ModTags.Items.TRANSFORMABLE_ITEMS)
|
||||
.add(ModItems.NUGGET.get())
|
||||
.add(ModItems.RAW_NUGGET.get())
|
||||
.add(Items.COAL)
|
||||
.add(Items.STICK)
|
||||
.add(Items.COMPASS);
|
||||
|
||||
tag(ItemTags.TRIMMABLE_ARMOR)
|
||||
.add(ModItems.NUGGET_HELMET.get())
|
||||
.add(ModItems.NUGGET_CHESTPLATE.get())
|
||||
.add(ModItems.NUGGET_LEGGINGS.get())
|
||||
.add(ModItems.NUGGET_BOOTS.get());
|
||||
tag(ItemTags.TRIM_MATERIALS)
|
||||
.add(ModItems.NUGGET.get());
|
||||
// tag(ItemTags.TRIM_TEMPLATES)
|
||||
// .add(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
tag(ModTags.Items.NUGGET_REPAIRS)
|
||||
.add(ModItems.NUGGET.get());
|
||||
}
|
||||
}
|
||||
@@ -1,173 +1,173 @@
|
||||
package xyz.sillyangel.nugget.datagen;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.item.Items;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.recipes.*;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModRecipeProvider extends RecipeProvider implements IConditionBuilder {
|
||||
public ModRecipeProvider(HolderLookup.Provider lookup, RecipeOutput recipeOutput) {
|
||||
super(lookup, recipeOutput);
|
||||
}
|
||||
|
||||
public static class Runner extends RecipeProvider.Runner {
|
||||
public Runner(PackOutput output, CompletableFuture<HolderLookup.Provider> providerCompletableFuture) {
|
||||
super(output, providerCompletableFuture);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected RecipeProvider createRecipeProvider(HolderLookup.Provider provider, RecipeOutput recipeOutput) {
|
||||
return new ModRecipeProvider(provider, recipeOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Recipes";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildRecipes() {
|
||||
List<ItemLike> NUGGET_SMELTABLES = List.of(ModItems.RAW_NUGGET.get(),
|
||||
ModBlocks.NUGGET_ORE.get(), ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
shaped(RecipeCategory.MISC, ModBlocks.NUGGET_BLOCK.get())
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
|
||||
shapeless(RecipeCategory.MISC, ModItems.NUGGET.get(), 9)
|
||||
.requires(ModBlocks.NUGGET_BLOCK.get())
|
||||
.unlockedBy(getHasName(ModBlocks.NUGGET_BLOCK.get()), has(ModBlocks.NUGGET_BLOCK.get())).save(this.output);
|
||||
|
||||
// RAW NUGGET
|
||||
|
||||
shaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.RAW_NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.RAW_NUGGET.get()), has(ModItems.RAW_NUGGET.get())).save(this.output);
|
||||
|
||||
shapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET.get(), 9)
|
||||
.requires(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.unlockedBy(getHasName(ModBlocks.RAW_NUGGET_BLOCK.get()), has(ModBlocks.RAW_NUGGET_BLOCK.get())).save(this.output);
|
||||
// TOOLS
|
||||
|
||||
//SWORD
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_SWORD.get())
|
||||
.pattern(" A ")
|
||||
.pattern(" A ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//PICAXE
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_PICKAXE.get())
|
||||
.pattern("AAA")
|
||||
.pattern(" B ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//AXE
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_AXE.get())
|
||||
.pattern(" AA")
|
||||
.pattern(" BA")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//SHOVEL
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_SHOVEL.get())
|
||||
.pattern(" A ")
|
||||
.pattern(" B ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//HOE
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_HOE.get())
|
||||
.pattern(" AA")
|
||||
.pattern(" B ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
|
||||
// END OF TOOLS
|
||||
|
||||
// start of armor
|
||||
// head!?!
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_HELMET.get())
|
||||
.pattern("AAA")
|
||||
.pattern("A A")
|
||||
.pattern(" ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//shirt
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_CHESTPLATE.get())
|
||||
.pattern("A A")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//pants?
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_LEGGINGS.get())
|
||||
.pattern("AAA")
|
||||
.pattern("A A")
|
||||
.pattern("A A")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//socks
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_BOOTS.get())
|
||||
.pattern(" ")
|
||||
.pattern("A A")
|
||||
.pattern("A A")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
|
||||
trimSmithing(ModItems.NUGGET_SMITHING_TEMPLATE.get(), ResourceKey.create(Registries.RECIPE,
|
||||
ResourceLocation.parse(getItemName(ModItems.NUGGET_SMITHING_TEMPLATE.get()) + "_smithing_trim")));
|
||||
|
||||
oreSmelting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
|
||||
oreBlasting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget");
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void oreSmelting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
|
||||
float pExperience, int pCookingTIme, String pGroup) {
|
||||
oreCooking(recipeOutput, RecipeSerializer.SMELTING_RECIPE, SmeltingRecipe::new, pIngredients, pCategory, pResult,
|
||||
pExperience, pCookingTIme, pGroup, "_from_smelting");
|
||||
}
|
||||
|
||||
protected void oreBlasting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
|
||||
float pExperience, int pCookingTime, String pGroup) {
|
||||
oreCooking(recipeOutput, RecipeSerializer.BLASTING_RECIPE, BlastingRecipe::new, pIngredients, pCategory, pResult,
|
||||
pExperience, pCookingTime, pGroup, "_from_blasting");
|
||||
}
|
||||
|
||||
protected <T extends AbstractCookingRecipe> void oreCooking(RecipeOutput recipeOutput, RecipeSerializer<T> pCookingSerializer, AbstractCookingRecipe.Factory<T> factory,
|
||||
List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup, String pRecipeName) {
|
||||
for(ItemLike itemlike : pIngredients) {
|
||||
SimpleCookingRecipeBuilder.generic(Ingredient.of(itemlike), pCategory, pResult, pExperience, pCookingTime, pCookingSerializer, factory).group(pGroup).unlockedBy(getHasName(itemlike), has(itemlike))
|
||||
.save(recipeOutput, NuggetMod.MOD_ID + ":" + getItemName(pResult) + pRecipeName + "_" + getItemName(itemlike));
|
||||
}
|
||||
}
|
||||
package dev.sillyangel.nugget.datagen;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.item.Items;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.data.PackOutput;
|
||||
import net.minecraft.data.recipes.*;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraftforge.common.crafting.conditions.IConditionBuilder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
public class ModRecipeProvider extends RecipeProvider implements IConditionBuilder {
|
||||
public ModRecipeProvider(HolderLookup.Provider lookup, RecipeOutput recipeOutput) {
|
||||
super(lookup, recipeOutput);
|
||||
}
|
||||
|
||||
public static class Runner extends RecipeProvider.Runner {
|
||||
public Runner(PackOutput output, CompletableFuture<HolderLookup.Provider> providerCompletableFuture) {
|
||||
super(output, providerCompletableFuture);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected RecipeProvider createRecipeProvider(HolderLookup.Provider provider, RecipeOutput recipeOutput) {
|
||||
return new ModRecipeProvider(provider, recipeOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Recipes";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buildRecipes() {
|
||||
List<ItemLike> NUGGET_SMELTABLES = List.of(ModItems.RAW_NUGGET.get(),
|
||||
ModBlocks.NUGGET_ORE.get(), ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
|
||||
shaped(RecipeCategory.MISC, ModBlocks.NUGGET_BLOCK.get())
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
|
||||
shapeless(RecipeCategory.MISC, ModItems.NUGGET.get(), 9)
|
||||
.requires(ModBlocks.NUGGET_BLOCK.get())
|
||||
.unlockedBy(getHasName(ModBlocks.NUGGET_BLOCK.get()), has(ModBlocks.NUGGET_BLOCK.get())).save(this.output);
|
||||
|
||||
// RAW NUGGET
|
||||
|
||||
shaped(RecipeCategory.MISC, ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.RAW_NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.RAW_NUGGET.get()), has(ModItems.RAW_NUGGET.get())).save(this.output);
|
||||
|
||||
shapeless(RecipeCategory.MISC, ModItems.RAW_NUGGET.get(), 9)
|
||||
.requires(ModBlocks.RAW_NUGGET_BLOCK.get())
|
||||
.unlockedBy(getHasName(ModBlocks.RAW_NUGGET_BLOCK.get()), has(ModBlocks.RAW_NUGGET_BLOCK.get())).save(this.output);
|
||||
// TOOLS
|
||||
|
||||
//SWORD
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_SWORD.get())
|
||||
.pattern(" A ")
|
||||
.pattern(" A ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//PICAXE
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_PICKAXE.get())
|
||||
.pattern("AAA")
|
||||
.pattern(" B ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//AXE
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_AXE.get())
|
||||
.pattern(" AA")
|
||||
.pattern(" BA")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//SHOVEL
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_SHOVEL.get())
|
||||
.pattern(" A ")
|
||||
.pattern(" B ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//HOE
|
||||
shaped(RecipeCategory.TOOLS, ModItems.NUGGET_HOE.get())
|
||||
.pattern(" AA")
|
||||
.pattern(" B ")
|
||||
.pattern(" B ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.define('B', Items.STICK)
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
|
||||
// END OF TOOLS
|
||||
|
||||
// start of armor
|
||||
// head!?!
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_HELMET.get())
|
||||
.pattern("AAA")
|
||||
.pattern("A A")
|
||||
.pattern(" ")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//shirt
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_CHESTPLATE.get())
|
||||
.pattern("A A")
|
||||
.pattern("AAA")
|
||||
.pattern("AAA")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//pants?
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_LEGGINGS.get())
|
||||
.pattern("AAA")
|
||||
.pattern("A A")
|
||||
.pattern("A A")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
//socks
|
||||
shaped(RecipeCategory.COMBAT, ModItems.NUGGET_BOOTS.get())
|
||||
.pattern(" ")
|
||||
.pattern("A A")
|
||||
.pattern("A A")
|
||||
.define('A', ModItems.NUGGET.get())
|
||||
.unlockedBy(getHasName(ModItems.NUGGET.get()), has(ModItems.NUGGET.get())).save(this.output);
|
||||
|
||||
trimSmithing(ModItems.NUGGET_SMITHING_TEMPLATE.get(), ResourceKey.create(Registries.RECIPE,
|
||||
Identifier.parse(getItemName(ModItems.NUGGET_SMITHING_TEMPLATE.get()) + "_smithing_trim")));
|
||||
|
||||
oreSmelting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 200, "nugget");
|
||||
oreBlasting(this.output, NUGGET_SMELTABLES, RecipeCategory.MISC, ModItems.NUGGET.get(), 0.25f, 100, "nugget");
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void oreSmelting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
|
||||
float pExperience, int pCookingTIme, String pGroup) {
|
||||
oreCooking(recipeOutput, RecipeSerializer.SMELTING_RECIPE, SmeltingRecipe::new, pIngredients, pCategory, pResult,
|
||||
pExperience, pCookingTIme, pGroup, "_from_smelting");
|
||||
}
|
||||
|
||||
protected void oreBlasting(RecipeOutput recipeOutput, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult,
|
||||
float pExperience, int pCookingTime, String pGroup) {
|
||||
oreCooking(recipeOutput, RecipeSerializer.BLASTING_RECIPE, BlastingRecipe::new, pIngredients, pCategory, pResult,
|
||||
pExperience, pCookingTime, pGroup, "_from_blasting");
|
||||
}
|
||||
|
||||
protected <T extends AbstractCookingRecipe> void oreCooking(RecipeOutput recipeOutput, RecipeSerializer<T> pCookingSerializer, AbstractCookingRecipe.Factory<T> factory,
|
||||
List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup, String pRecipeName) {
|
||||
for(ItemLike itemlike : pIngredients) {
|
||||
SimpleCookingRecipeBuilder.generic(Ingredient.of(itemlike), pCategory, pResult, pExperience, pCookingTime, pCookingSerializer, factory).group(pGroup).unlockedBy(getHasName(itemlike), has(itemlike))
|
||||
.save(recipeOutput, NuggetMod.MOD_ID + ":" + getItemName(pResult) + pRecipeName + "_" + getItemName(itemlike));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,22 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
package dev.sillyangel.nugget.item;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.util.ModTags;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.util.ModTags;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.item.equipment.ArmorMaterial;
|
||||
import net.minecraft.world.item.equipment.ArmorType;
|
||||
import net.minecraft.world.item.equipment.EquipmentAsset;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
public class ModArmorMaterials {
|
||||
public static final ResourceKey<EquipmentAsset> NUGGET_EQUIPMENT_ASSET =
|
||||
ResourceKey.create(ResourceKey.createRegistryKey(Identifier.withDefaultNamespace("equipment_asset")),
|
||||
Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
|
||||
|
||||
public static final ArmorMaterial NUGGET_ARMOR_MATERIAL = new ArmorMaterial(1200, Util.make(new EnumMap<>(ArmorType.class),
|
||||
attribute -> {
|
||||
attribute.put(ArmorType.BOOTS, 5);
|
||||
@@ -18,5 +25,6 @@ public class ModArmorMaterials {
|
||||
attribute.put(ArmorType.HELMET, 5);
|
||||
attribute.put(ArmorType.BODY, 11);
|
||||
}), 20, SoundEvents.ARMOR_EQUIP_NETHERITE,
|
||||
4f, 0.1f, ModTags.Items.NUGGET_REPAIRS, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
|
||||
}
|
||||
4f, 0.1f, ModTags.Items.NUGGET_REPAIRS, NUGGET_EQUIPMENT_ASSET);
|
||||
}
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
|
||||
public class ModCreativeModeTabs {
|
||||
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
|
||||
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, NuggetMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<CreativeModeTab> NUGGET_ITEMS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_items_tab",
|
||||
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModItems.NUGGET.get()))
|
||||
.title(Component.translatable("creativetab.nuggetmod.nugget_items"))
|
||||
.displayItems((itemDisplayParameters, output) -> {
|
||||
output.accept(ModItems.NUGGET.get());
|
||||
output.accept(ModItems.RAW_NUGGET.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_SWORD.get());
|
||||
output.accept(ModItems.NUGGET_PICKAXE.get());
|
||||
output.accept(ModItems.NUGGET_SHOVEL.get());
|
||||
output.accept(ModItems.NUGGET_AXE.get());
|
||||
output.accept(ModItems.NUGGET_HOE.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_HELMET.get());
|
||||
output.accept(ModItems.NUGGET_CHESTPLATE.get());
|
||||
output.accept(ModItems.NUGGET_LEGGINGS.get());
|
||||
output.accept(ModItems.NUGGET_BOOTS.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_HORSE_ARMOR.get());
|
||||
output.accept(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_MUSIC_DISC.get());
|
||||
|
||||
}).build());
|
||||
|
||||
public static final RegistryObject<CreativeModeTab> NUGGET_BLOCKS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_blocks_tab",
|
||||
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK.get()))
|
||||
.withTabsBefore(NUGGET_ITEMS_TAB.getId())
|
||||
.title(Component.translatable("creativetab.nuggetmod.nugget_blocks"))
|
||||
.displayItems((itemDisplayParameters, output) -> {
|
||||
output.accept(ModBlocks.NUGGET_BLOCK.get());
|
||||
output.accept(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
output.accept(ModBlocks.NUGGET_ORE.get());
|
||||
output.accept(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
}).build());
|
||||
|
||||
|
||||
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
CREATIVE_MODE_TABS.register(eventBus);
|
||||
}
|
||||
}
|
||||
package dev.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.eventbus.api.bus.BusGroup;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
|
||||
public class ModCreativeModeTabs {
|
||||
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS =
|
||||
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, NuggetMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<CreativeModeTab> NUGGET_ITEMS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_items_tab",
|
||||
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModItems.NUGGET.get()))
|
||||
.title(Component.translatable("creativetab.nuggetmod.nugget_items"))
|
||||
.displayItems((itemDisplayParameters, output) -> {
|
||||
output.accept(ModItems.NUGGET.get());
|
||||
output.accept(ModItems.RAW_NUGGET.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_SWORD.get());
|
||||
output.accept(ModItems.NUGGET_PICKAXE.get());
|
||||
output.accept(ModItems.NUGGET_SHOVEL.get());
|
||||
output.accept(ModItems.NUGGET_AXE.get());
|
||||
output.accept(ModItems.NUGGET_HOE.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_HELMET.get());
|
||||
output.accept(ModItems.NUGGET_CHESTPLATE.get());
|
||||
output.accept(ModItems.NUGGET_LEGGINGS.get());
|
||||
output.accept(ModItems.NUGGET_BOOTS.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_HORSE_ARMOR.get());
|
||||
output.accept(ModItems.NUGGET_SMITHING_TEMPLATE.get());
|
||||
|
||||
output.accept(ModItems.NUGGET_MUSIC_DISC.get());
|
||||
|
||||
}).build());
|
||||
|
||||
public static final RegistryObject<CreativeModeTab> NUGGET_BLOCKS_TAB = CREATIVE_MODE_TABS.register("nuggetmod_blocks_tab",
|
||||
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModBlocks.NUGGET_BLOCK.get()))
|
||||
.withTabsBefore(NUGGET_ITEMS_TAB.getId())
|
||||
.title(Component.translatable("creativetab.nuggetmod.nugget_blocks"))
|
||||
.displayItems((itemDisplayParameters, output) -> {
|
||||
output.accept(ModBlocks.NUGGET_BLOCK.get());
|
||||
output.accept(ModBlocks.RAW_NUGGET_BLOCK.get());
|
||||
output.accept(ModBlocks.NUGGET_ORE.get());
|
||||
output.accept(ModBlocks.NUGGET_DEEPSLATE_ORE.get());
|
||||
}).build());
|
||||
|
||||
|
||||
|
||||
|
||||
public static void register(BusGroup busGroup) {
|
||||
CREATIVE_MODE_TABS.register(busGroup);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
|
||||
public class ModFoodProperties {
|
||||
public static final FoodProperties Nugget = new FoodProperties.Builder().nutrition(5).saturationModifier(0.5f)
|
||||
.build();
|
||||
}
|
||||
package dev.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
|
||||
public class ModFoodProperties {
|
||||
public static final FoodProperties Nugget = new FoodProperties.Builder().nutrition(5).saturationModifier(0.5f)
|
||||
.build();
|
||||
}
|
||||
96
src/main/java/dev/sillyangel/nugget/item/ModItems.java
Normal file
96
src/main/java/dev/sillyangel/nugget/item/ModItems.java
Normal file
@@ -0,0 +1,96 @@
|
||||
package dev.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.item.equipment.ArmorType;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraftforge.eventbus.api.bus.BusGroup;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ShovelItem;
|
||||
import net.minecraft.world.item.AxeItem;
|
||||
import net.minecraft.world.item.HoeItem;
|
||||
import net.minecraft.world.item.SmithingTemplateItem;
|
||||
import dev.sillyangel.nugget.sound.ModSounds;
|
||||
|
||||
|
||||
public class ModItems {
|
||||
public static final DeferredRegister<Item> ITEMS =
|
||||
DeferredRegister.create(ForgeRegistries.ITEMS, NuggetMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Item> NUGGET = ITEMS.register("nugget",
|
||||
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")))
|
||||
.food(ModFoodProperties.Nugget)));
|
||||
|
||||
public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
|
||||
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_sword")))
|
||||
.sword(ModToolTiers.NUGGET, 3.0F, -2.4F)));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_pickaxe")))
|
||||
.pickaxe(ModToolTiers.NUGGET, 1.0F, -2.8F)));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
|
||||
() -> new ShovelItem(ModToolTiers.NUGGET, 1.5f, -3.0f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_shovel")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
|
||||
() -> new AxeItem(ModToolTiers.NUGGET, 6, -3.2f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_axe")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
|
||||
() -> new HoeItem(ModToolTiers.NUGGET, 0, -3.0f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_hoe")))));
|
||||
|
||||
// armor things
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_HELMET = ITEMS.register("nugget_helmet",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_helmet")))
|
||||
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.HELMET)));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_CHESTPLATE = ITEMS.register("nugget_chestplate",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_chestplate")))
|
||||
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.CHESTPLATE)));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_LEGGINGS = ITEMS.register("nugget_leggings",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_leggings")))
|
||||
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.LEGGINGS)));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_BOOTS = ITEMS.register("nugget_boots",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_boots")))
|
||||
.humanoidArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.BOOTS)));
|
||||
|
||||
// horse armor
|
||||
public static final RegistryObject<Item> NUGGET_HORSE_ARMOR = ITEMS.register("nugget_horse_armor",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_horse_armor")))
|
||||
.horseArmor(ModArmorMaterials.NUGGET_ARMOR_MATERIAL)
|
||||
.stacksTo(1)));
|
||||
// smithing temp
|
||||
public static final RegistryObject<Item> NUGGET_SMITHING_TEMPLATE = ITEMS.register("nugget_armor_trim_smithing_template",
|
||||
() -> SmithingTemplateItem.createArmorTrimTemplate(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_armor_trim_smithing_template")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_MUSIC_DISC = ITEMS.register("nugget_music_disc",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_music_disc")))
|
||||
.jukeboxPlayable(ModSounds.NUGGET_THEME_KEY).stacksTo(1)));
|
||||
|
||||
|
||||
public static void register(BusGroup busGroup) {
|
||||
ITEMS.register(busGroup);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.world.item.ToolMaterial;
|
||||
import xyz.sillyangel.nugget.util.ModTags;
|
||||
|
||||
public class ModToolTiers {
|
||||
public static final ToolMaterial NUGGET = new ToolMaterial(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL,
|
||||
1500, 8f, 3.5f, 22, ModTags.Items.NUGGET_REPAIRS);
|
||||
}
|
||||
package dev.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.world.item.ToolMaterial;
|
||||
import dev.sillyangel.nugget.util.ModTags;
|
||||
|
||||
public class ModToolTiers {
|
||||
public static final ToolMaterial NUGGET = new ToolMaterial(ModTags.Blocks.INCORRECT_FOR_NUGGET_TOOL,
|
||||
1500, 8f, 3.5f, 22, ModTags.Items.NUGGET_REPAIRS);
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
package xyz.sillyangel.nugget.sound;
|
||||
package dev.sillyangel.nugget.sound;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.item.JukeboxSong;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.bus.BusGroup;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
@@ -18,14 +18,14 @@ public class ModSounds {
|
||||
|
||||
public static final RegistryObject<SoundEvent> NUGGET_THEME = registerSoundEvent("nugget_theme");
|
||||
public static final ResourceKey<JukeboxSong> NUGGET_THEME_KEY = ResourceKey.create(Registries.JUKEBOX_SONG,
|
||||
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_theme"));
|
||||
Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_theme"));
|
||||
|
||||
|
||||
|
||||
private static RegistryObject<SoundEvent> registerSoundEvent(String name) {
|
||||
return SOUND_EVENT.register(name, () -> SoundEvent.createVariableRangeEvent(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name)));
|
||||
return SOUND_EVENT.register(name, () -> SoundEvent.createVariableRangeEvent(Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name)));
|
||||
}
|
||||
public static void register(IEventBus eventBus) {
|
||||
SOUND_EVENT.register(eventBus);
|
||||
public static void register(BusGroup busGroup) {
|
||||
SOUND_EVENT.register(busGroup);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
package xyz.sillyangel.nugget.trim;
|
||||
package dev.sillyangel.nugget.trim;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.Util;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.Style;
|
||||
import net.minecraft.network.chat.TextColor;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.equipment.trim.TrimMaterial;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
|
||||
public class ModTrimMaterials {
|
||||
public static final ResourceKey<TrimMaterial> NUGGET =
|
||||
ResourceKey.create(Registries.TRIM_MATERIAL, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
|
||||
ResourceKey.create(Registries.TRIM_MATERIAL, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
|
||||
|
||||
public static void bootstrap(BootstrapContext<TrimMaterial> context) {
|
||||
register(context, NUGGET, ModItems.NUGGET.get(), Style.EMPTY.withColor(TextColor.parseColor("#f9b042").getOrThrow()), 0.1F);
|
||||
@@ -1,20 +1,20 @@
|
||||
package xyz.sillyangel.nugget.trim;
|
||||
package dev.sillyangel.nugget.trim;
|
||||
|
||||
import net.minecraft.world.item.equipment.trim.TrimPattern;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import xyz.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.Util;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.item.ModItems;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
public class ModTrimPatterns {
|
||||
public static final ResourceKey<TrimPattern> NUGGET = ResourceKey.create(Registries.TRIM_PATTERN,
|
||||
ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
|
||||
Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget"));
|
||||
|
||||
public static void bootstrap(BootstrapContext<TrimPattern> context) {
|
||||
register(context, ModItems.NUGGET_SMITHING_TEMPLATE.get(), NUGGET);
|
||||
@@ -1,4 +1,4 @@
|
||||
package xyz.sillyangel.nugget.util;
|
||||
package dev.sillyangel.nugget.util;
|
||||
|
||||
public class ModItemProperites {
|
||||
// i dont know what to put here?!
|
||||
@@ -1,29 +1,29 @@
|
||||
package xyz.sillyangel.nugget.util;
|
||||
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
public class ModTags {
|
||||
public static class Blocks {
|
||||
public static final TagKey<Block> NEEDS_NUGGET_TOOL = createTag("needs_nugget_tool");
|
||||
public static final TagKey<Block> INCORRECT_FOR_NUGGET_TOOL = createTag("incorrect_for_nugget_tool");
|
||||
|
||||
private static TagKey<Block> createTag(String name) {
|
||||
return BlockTags.create(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Items {
|
||||
public static final TagKey<Item> TRANSFORMABLE_ITEMS = createTag("transformable_items");
|
||||
public static final TagKey<Item> NUGGET_REPAIRS = createTag("nugget_repairs");
|
||||
|
||||
private static TagKey<Item> createTag(String name) {
|
||||
return ItemTags.create(ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
}
|
||||
package dev.sillyangel.nugget.util;
|
||||
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
public class ModTags {
|
||||
public static class Blocks {
|
||||
public static final TagKey<Block> NEEDS_NUGGET_TOOL = createTag("needs_nugget_tool");
|
||||
public static final TagKey<Block> INCORRECT_FOR_NUGGET_TOOL = createTag("incorrect_for_nugget_tool");
|
||||
|
||||
private static TagKey<Block> createTag(String name) {
|
||||
return BlockTags.create(Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Items {
|
||||
public static final TagKey<Item> TRANSFORMABLE_ITEMS = createTag("transformable_items");
|
||||
public static final TagKey<Item> NUGGET_REPAIRS = createTag("nugget_repairs");
|
||||
|
||||
private static TagKey<Item> createTag(String name) {
|
||||
return ItemTags.create(Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
package xyz.sillyangel.nugget.worldgen;
|
||||
package dev.sillyangel.nugget.worldgen;
|
||||
|
||||
import net.minecraft.core.HolderSet;
|
||||
import net.minecraft.tags.BiomeTags;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraftforge.common.world.ForgeBiomeModifiers;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraftforge.common.world.BiomeModifier;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
@@ -29,6 +29,6 @@ public class ModBiomeModifiers {
|
||||
}
|
||||
|
||||
private static ResourceKey<BiomeModifier> registerKey(String name) {
|
||||
return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
package xyz.sillyangel.nugget.worldgen;
|
||||
package dev.sillyangel.nugget.worldgen;
|
||||
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
||||
import xyz.sillyangel.nugget.block.ModBlocks;
|
||||
import dev.sillyangel.nugget.block.ModBlocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ModConfiguredFeatures {
|
||||
}
|
||||
|
||||
public static ResourceKey<ConfiguredFeature<?, ?>> registerKey(String name) {
|
||||
return ResourceKey.create(Registries.CONFIGURED_FEATURE, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
return ResourceKey.create(Registries.CONFIGURED_FEATURE, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstrapContext<ConfiguredFeature<?, ?>> context,
|
||||
@@ -1,4 +1,4 @@
|
||||
package xyz.sillyangel.nugget.worldgen;
|
||||
package dev.sillyangel.nugget.worldgen;
|
||||
|
||||
import net.minecraft.world.level.levelgen.placement.*;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package xyz.sillyangel.nugget.worldgen;
|
||||
package dev.sillyangel.nugget.worldgen;
|
||||
|
||||
import net.minecraft.world.level.levelgen.VerticalAnchor;
|
||||
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import dev.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstrapContext;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacementModifier;
|
||||
@@ -28,7 +28,7 @@ public class ModPlacedFeatures {
|
||||
}
|
||||
|
||||
private static ResourceKey<PlacedFeature> registerKey(String name) {
|
||||
return ResourceKey.create(Registries.PLACED_FEATURE, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
return ResourceKey.create(Registries.PLACED_FEATURE, Identifier.fromNamespaceAndPath(NuggetMod.MOD_ID, name));
|
||||
}
|
||||
|
||||
private static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> key, Holder<ConfiguredFeature<?, ?>> configuration,
|
||||
@@ -1,63 +0,0 @@
|
||||
package xyz.sillyangel.nugget;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.config.ModConfigEvent;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// An example config class. This is not required, but it's a good idea to have one to keep your config organized.
|
||||
// Demonstrates how to use Forge's config APIs
|
||||
@Mod.EventBusSubscriber(modid = NuggetMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class Config
|
||||
{
|
||||
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
||||
|
||||
private static final ForgeConfigSpec.BooleanValue LOG_DIRT_BLOCK = BUILDER
|
||||
.comment("Whether to log the dirt block on common setup")
|
||||
.define("logDirtBlock", true);
|
||||
|
||||
private static final ForgeConfigSpec.IntValue MAGIC_NUMBER = BUILDER
|
||||
.comment("A magic number")
|
||||
.defineInRange("magicNumber", 42, 0, Integer.MAX_VALUE);
|
||||
|
||||
public static final ForgeConfigSpec.ConfigValue<String> MAGIC_NUMBER_INTRODUCTION = BUILDER
|
||||
.comment("What you want the introduction message to be for the magic number")
|
||||
.define("magicNumberIntroduction", "The magic number is... ");
|
||||
|
||||
// a list of strings that are treated as resource locations for items
|
||||
private static final ForgeConfigSpec.ConfigValue<List<? extends String>> ITEM_STRINGS = BUILDER
|
||||
.comment("A list of items to log on common setup.")
|
||||
.defineListAllowEmpty("items", List.of("minecraft:iron_ingot"), Config::validateItemName);
|
||||
|
||||
static final ForgeConfigSpec SPEC = BUILDER.build();
|
||||
|
||||
public static boolean logDirtBlock;
|
||||
public static int magicNumber;
|
||||
public static String magicNumberIntroduction;
|
||||
public static Set<Item> items;
|
||||
|
||||
private static boolean validateItemName(final Object obj)
|
||||
{
|
||||
return obj instanceof final String itemName && ForgeRegistries.ITEMS.containsKey(ResourceLocation.tryParse(itemName));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
static void onLoad(final ModConfigEvent event)
|
||||
{
|
||||
logDirtBlock = LOG_DIRT_BLOCK.get();
|
||||
magicNumber = MAGIC_NUMBER.get();
|
||||
magicNumberIntroduction = MAGIC_NUMBER_INTRODUCTION.get();
|
||||
|
||||
// convert the list of strings into a set of items
|
||||
items = ITEM_STRINGS.get().stream()
|
||||
.map(itemName -> ForgeRegistries.ITEMS.getValue(ResourceLocation.tryParse(itemName)))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package xyz.sillyangel.nugget.item;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.item.equipment.ArmorType;
|
||||
import xyz.sillyangel.nugget.NuggetMod;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import net.minecraft.world.item.*;
|
||||
import xyz.sillyangel.nugget.sound.ModSounds;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ModItems {
|
||||
public static final DeferredRegister<Item> ITEMS =
|
||||
DeferredRegister.create(ForgeRegistries.ITEMS, NuggetMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Item> NUGGET = ITEMS.register("nugget",
|
||||
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget")))
|
||||
.food(ModFoodProperties.Nugget)) {
|
||||
@Override
|
||||
public void appendHoverText(ItemStack pStack, TooltipContext pContext, List<Component> pTooltipComponent, TooltipFlag pTooltipFlag) {
|
||||
pTooltipComponent.add(Component.translatable("item.nuggetmod.nugget.tooltip"));
|
||||
super.appendHoverText(pStack, pContext, pTooltipComponent, pTooltipFlag);
|
||||
}
|
||||
});
|
||||
|
||||
public static final RegistryObject<Item> RAW_NUGGET = ITEMS.register("raw_nugget",
|
||||
() -> new Item(new Item.Properties().setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "raw_nugget")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_SWORD = ITEMS.register("nugget_sword",
|
||||
() -> new SwordItem(ModToolTiers.NUGGET, 3, -2.4f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_sword")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_PICKAXE = ITEMS.register("nugget_pickaxe",
|
||||
() -> new PickaxeItem(ModToolTiers.NUGGET, 1, -2.8f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_pickaxe")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_SHOVEL = ITEMS.register("nugget_shovel",
|
||||
() -> new ShovelItem(ModToolTiers.NUGGET, 1.5f, -3.0f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_shovel")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_AXE = ITEMS.register("nugget_axe",
|
||||
() -> new AxeItem(ModToolTiers.NUGGET, 6, -3.2f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_axe")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_HOE = ITEMS.register("nugget_hoe",
|
||||
() -> new HoeItem(ModToolTiers.NUGGET, 0, -3.0f, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_hoe")))));
|
||||
|
||||
// armor things
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_HELMET = ITEMS.register("nugget_helmet",
|
||||
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.HELMET,
|
||||
new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_helmet")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_CHESTPLATE = ITEMS.register("nugget_chestplate",
|
||||
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.CHESTPLATE,
|
||||
new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_chestplate")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_LEGGINGS = ITEMS.register("nugget_leggings",
|
||||
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.LEGGINGS,
|
||||
new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_leggings")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_BOOTS = ITEMS.register("nugget_boots",
|
||||
() -> new ArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, ArmorType.BOOTS,
|
||||
new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_boots")))));
|
||||
|
||||
// horse armor
|
||||
public static final RegistryObject<Item> NUGGET_HORSE_ARMOR = ITEMS.register("nugget_horse_armor",
|
||||
() -> new AnimalArmorItem(ModArmorMaterials.NUGGET_ARMOR_MATERIAL, AnimalArmorItem.BodyType.EQUESTRIAN, new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_horse_armor")))
|
||||
.stacksTo(1)));
|
||||
// smithing temp
|
||||
public static final RegistryObject<Item> NUGGET_SMITHING_TEMPLATE = ITEMS.register("nugget_armor_trim_smithing_template",
|
||||
() -> SmithingTemplateItem.createArmorTrimTemplate(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_armor_trim_smithing_template")))));
|
||||
|
||||
public static final RegistryObject<Item> NUGGET_MUSIC_DISC = ITEMS.register("nugget_music_disc",
|
||||
() -> new Item(new Item.Properties()
|
||||
.setId(ResourceKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(NuggetMod.MOD_ID, "nugget_music_disc")))
|
||||
.jukeboxPlayable(ModSounds.NUGGET_THEME_KEY).stacksTo(1)));
|
||||
|
||||
|
||||
public static void register(IEventBus eventBus) {
|
||||
ITEMS.register(eventBus);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ loaderVersion="${loader_version_range}" #mandatory This is typically bumped ever
|
||||
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
|
||||
license="${mod_license}"
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
|
||||
issueTrackerURL="https://github.com/sillyangel/nugget" #optional
|
||||
# If your mod is purely client-side and has no multiplayer functionality (be it dedicated servers or Open to LAN),
|
||||
# set this to true, and Forge will set the correct displayTest for you and skip loading your mod on dedicated servers.
|
||||
#clientSideOnly=true #optional - defaults to false if absent
|
||||
@@ -26,9 +26,9 @@ displayName="${mod_name}" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
|
||||
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
|
||||
displayURL="https://sillyangel.dev/" #optional
|
||||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
#logoFile="examplemod.png" #optional
|
||||
logoFile="splash.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
#credits="" #optional
|
||||
# A text field displayed in the mod UI
|
||||
|
||||
Reference in New Issue
Block a user