diff options
| author | 2024-01-05 22:18:56 +0100 | |
|---|---|---|
| committer | 2024-01-05 22:18:56 +0100 | |
| commit | 9445749ede3c61d3db9324184971b319b4a8bd1d (patch) | |
| tree | 22b1b6b2c337756fe6d0b97effbca60fb8a8c961 /src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java | |
| download | mc-eris-alchemy-9445749ede3c61d3db9324184971b319b4a8bd1d.tar.gz mc-eris-alchemy-9445749ede3c61d3db9324184971b319b4a8bd1d.tar.xz mc-eris-alchemy-9445749ede3c61d3db9324184971b319b4a8bd1d.zip | |
Initial Commit
Diffstat (limited to 'src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java')
| -rw-r--r-- | src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java b/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java new file mode 100644 index 0000000..34e6b09 --- /dev/null +++ b/src/main/java/lv/enes/mc/eris_alchemy/ErisAlchemy.java | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | package lv.enes.mc.eris_alchemy; | ||
| 2 | |||
| 3 | import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; | ||
| 4 | import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
| 5 | import net.minecraft.core.Registry; | ||
| 6 | import net.minecraft.core.registries.BuiltInRegistries; | ||
| 7 | import net.minecraft.core.registries.Registries; | ||
| 8 | import net.minecraft.network.chat.Component; | ||
| 9 | import net.minecraft.resources.ResourceLocation; | ||
| 10 | import net.minecraft.world.item.CreativeModeTab; | ||
| 11 | import net.minecraft.world.item.CreativeModeTabs; | ||
| 12 | import net.minecraft.world.item.Item; | ||
| 13 | import net.minecraft.world.item.ItemStack; | ||
| 14 | import org.quiltmc.loader.api.ModContainer; | ||
| 15 | import org.quiltmc.qsl.base.api.entrypoint.ModInitializer; | ||
| 16 | import org.quiltmc.qsl.item.setting.api.QuiltItemSettings; | ||
| 17 | import org.slf4j.Logger; | ||
| 18 | import org.slf4j.LoggerFactory; | ||
| 19 | |||
| 20 | public class ErisAlchemy implements ModInitializer { | ||
| 21 | public static final String ID = "eris_alchemy"; | ||
| 22 | public static final Logger LOGGER = LoggerFactory.getLogger(ID); | ||
| 23 | |||
| 24 | // Aside from crafting recipe inputs, covalence dusts can be used to repair equipment via shapeless crafting | ||
| 25 | // Low covalence dust: | ||
| 26 | // - wooden and stone tools | ||
| 27 | // - leather armour | ||
| 28 | // - fishing rods | ||
| 29 | // - wooden bows | ||
| 30 | // - turtle shells | ||
| 31 | // Medium covalence dust: | ||
| 32 | // - iron, gold, bronze, ruby, sapphire, and green sapphire tools and armour | ||
| 33 | // - flints & steels | ||
| 34 | // - shears | ||
| 35 | // - elytras | ||
| 36 | // High covalence dust: | ||
| 37 | // - diamond and netherite tools and armour | ||
| 38 | // 8 dusts are enough to repair 100% :3 | ||
| 39 | public static final Item LOW_COVALENCE_DUST = new Item(new QuiltItemSettings()); | ||
| 40 | public static final Item MEDIUM_COVALENCE_DUST = new Item(new QuiltItemSettings()); | ||
| 41 | public static final Item HIGH_COVALENCE_DUST = new Item(new QuiltItemSettings()); | ||
| 42 | |||
| 43 | public static final CreativeModeTab ITEM_GROUP = FabricItemGroup.builder() | ||
| 44 | .icon(() -> new ItemStack(LOW_COVALENCE_DUST)) | ||
| 45 | .title(Component.translatable("itemGroup.eris_alchemy.item_group")) | ||
| 46 | .displayItems((context, entries) -> { | ||
| 47 | entries.accept(LOW_COVALENCE_DUST); | ||
| 48 | entries.accept(MEDIUM_COVALENCE_DUST); | ||
| 49 | entries.accept(HIGH_COVALENCE_DUST); | ||
| 50 | }) | ||
| 51 | .build(); | ||
| 52 | |||
| 53 | @Override | ||
| 54 | public void onInitialize(ModContainer mod) { | ||
| 55 | LOGGER.info("Hello World from {}!", mod.metadata().name()); | ||
| 56 | if (!mod.metadata().id().equals(ID)) { | ||
| 57 | throw new RuntimeException("Hardcoded mod ID doesn't match the configured one!"); | ||
| 58 | } | ||
| 59 | |||
| 60 | Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(ID, "item_group"), ITEM_GROUP); | ||
| 61 | |||
| 62 | Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(ID, "low_covalence_dust"), LOW_COVALENCE_DUST); | ||
| 63 | Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(ID, "medium_covalence_dust"), MEDIUM_COVALENCE_DUST); | ||
| 64 | Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(ID, "high_covalence_dust"), HIGH_COVALENCE_DUST); | ||
| 65 | |||
| 66 | Registry.register(BuiltInRegistries.RECIPE_SERIALIZER, CovalenceRepair.Serializer.ID, CovalenceRepair.Serializer.INSTANCE); | ||
| 67 | } | ||
| 68 | } | ||