From 60c8a9c62cd2c7b97317ba2cb76a5d3b4d95fa2d Mon Sep 17 00:00:00 2001 From: Unix Date: Thu, 7 Dec 2023 19:10:23 -0600 Subject: [PATCH] initial alabli --- build.gradle | 15 ++++++--------- gradle.properties | 4 ++-- .../io/github/unix_supremacist/Alchemist.java | 16 ++-------------- .../unix_supremacist/content/AlchemistItems.java | 7 ++----- .../unix_supremacist/interfaces/AreaBox.java | 4 ++-- .../item/AbstractEmpowerableItem.java | 4 ++-- .../item/AlchemistBlockItem.java | 4 ++-- .../item/AlchemistDiggerItem.java | 4 ++-- .../github/unix_supremacist/item/GaleItem.java | 4 ++-- src/main/resources/fabric.mod.json | 4 ++-- 10 files changed, 24 insertions(+), 42 deletions(-) diff --git a/build.gradle b/build.gradle index 466548f..14c5cd6 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,7 @@ repositories { name = "TerraformersMC" url = "https://maven.terraformersmc.com/" } + mavenLocal() } loom { @@ -77,14 +78,14 @@ sourceSets { dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings loom.layered() { - officialMojangMappings() - //parchment("org.parchmentmc.data:parchment-1.20.1:2023.06.26@zip") - } + mappings loom.officialMojangMappings() modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modImplementation ("io.github.unix-supremacist:alabli:1.0.0"){ + transitive = false + } modImplementation "TechReborn:TechReborn-1.20:5.9.1" - include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.0-rc.4"))) + //include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.0-rc.4"))) include modImplementation("net.feltmc:felt-splash-api:1.0.0-1.20.1"){ exclude(group: "com.terraformersmc") } @@ -101,11 +102,7 @@ dependencies { modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0" modImplementation "dev.emi:trinkets:3.8.0" modRuntimeOnly "maven.modrinth:jei:16.0.0.28" - //modRuntimeOnly "maven.modrinth:architectury-api:10.0.7+fabric" - //modRuntimeOnly "maven.modrinth:cloth-config:12.0.107+fabric" - //modRuntimeOnly "maven.modrinth:rei:13.0.654+fabric" modRuntimeOnly "maven.modrinth:modernfix:${project.modernfix_version}" - //modRuntimeOnly "maven.modrinth:ferrite-core:6.0.0-fabric" compileOnly 'org.projectlombok:lombok:1.18.24' annotationProcessor 'org.projectlombok:lombok:1.18.24' diff --git a/gradle.properties b/gradle.properties index 58e7190..aa777a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,12 +6,12 @@ org.gradle.parallel=true # check these on https://fabricmc.net/develop minecraft_version=1.20.2 yarn_mappings=1.20.2+build.1 -loader_version=0.14.22 +loader_version=0.15.0 # Mod Properties mod_version=1.1.0 modid=alchemist -maven_group=com.example +maven_group=io.github.unix-supremacist archives_base_name=alchemist # Dependencies diff --git a/src/main/java/io/github/unix_supremacist/Alchemist.java b/src/main/java/io/github/unix_supremacist/Alchemist.java index 1c3169a..8a5e66b 100644 --- a/src/main/java/io/github/unix_supremacist/Alchemist.java +++ b/src/main/java/io/github/unix_supremacist/Alchemist.java @@ -1,39 +1,27 @@ package io.github.unix_supremacist; +import io.github.unix_supremacist.alabli.Alabli; import io.github.unix_supremacist.content.AlchemistBlocks; import io.github.unix_supremacist.content.AlchemistItems; import io.github.unix_supremacist.content.AlchemistSplashes; import io.github.unix_supremacist.data.BlockTag; import io.github.unix_supremacist.item.AbstractEmpowerableItem; import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; -import net.minecraft.core.Registry; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class Alchemist { public static final String MODID = "alchemist"; - public static final Logger LOGGER = LoggerFactory.getLogger(MODID); public static final ResourceLocation empower_packet = new ResourceLocation(Alchemist.MODID, "empower_packet"); - public static final CreativeModeTab tab = FabricItemGroup.builder() - .icon(() -> new ItemStack(AlchemistItems.philosophers_stone.getItem())) - .title(Component.translatable("itemGroup."+MODID)) - .build(); public static void Init(){ - LOGGER.info("Welcome to the World of Alchemy!"); - Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(MODID, "tab"), tab); AlchemistSplashes.init(); AlchemistBlocks.values(); //force the enum to load AlchemistItems.values(); //force the enum to load + Alabli.initializeCreativeTab(); CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> { BlockTag.init(); }); diff --git a/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java b/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java index 319bb28..847144f 100644 --- a/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java +++ b/src/main/java/io/github/unix_supremacist/content/AlchemistItems.java @@ -1,13 +1,12 @@ package io.github.unix_supremacist.content; import io.github.unix_supremacist.Alchemist; +import io.github.unix_supremacist.alabli.Alabli; import io.github.unix_supremacist.item.*; import lombok.Getter; -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.registry.FuelRegistry; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.Item.Properties; @@ -66,8 +65,6 @@ public enum AlchemistItems { this.item = item; FuelRegistry.INSTANCE.add(item, burntime); Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(Alchemist.MODID, this.name()), item); - ItemGroupEvents.modifyEntriesEvent(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Alchemist.MODID, "tab"))).register(content -> { - content.accept(item); - }); + Alabli.items.add(item); } } diff --git a/src/main/java/io/github/unix_supremacist/interfaces/AreaBox.java b/src/main/java/io/github/unix_supremacist/interfaces/AreaBox.java index 1978182..2feff04 100644 --- a/src/main/java/io/github/unix_supremacist/interfaces/AreaBox.java +++ b/src/main/java/io/github/unix_supremacist/interfaces/AreaBox.java @@ -1,6 +1,6 @@ package io.github.unix_supremacist.interfaces; -import io.github.unix_supremacist.Alchemist; +import io.github.unix_supremacist.alabli.Alabli; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -32,7 +32,7 @@ default ArrayList getAreaFromFacing(Direction dir, BlockPos anchor, in case DOWN: return getArea(dir, anchor, new BlockPos(-size, 0, -size), new BlockPos(size, depth, size)); default: - Alchemist.LOGGER.error("HOW DID YOU CLICK A DIRECTION THAT ISN'T NORTH SOUTH EAST WEST UP OR DOWN"); + Alabli.LOGGER.error("HOW DID YOU CLICK A DIRECTION THAT ISN'T NORTH SOUTH EAST WEST UP OR DOWN"); return null; } } diff --git a/src/main/java/io/github/unix_supremacist/item/AbstractEmpowerableItem.java b/src/main/java/io/github/unix_supremacist/item/AbstractEmpowerableItem.java index 91e002a..eeb8996 100644 --- a/src/main/java/io/github/unix_supremacist/item/AbstractEmpowerableItem.java +++ b/src/main/java/io/github/unix_supremacist/item/AbstractEmpowerableItem.java @@ -1,13 +1,13 @@ package io.github.unix_supremacist.item; +import io.github.unix_supremacist.alabli.AlabliItem; import io.github.unix_supremacist.interfaces.DurablityBar; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; -public class AbstractEmpowerableItem extends Item implements DurablityBar { +public class AbstractEmpowerableItem extends AlabliItem implements DurablityBar { protected final int maxPower; public AbstractEmpowerableItem(Properties properties, int maxPower) { super(properties); diff --git a/src/main/java/io/github/unix_supremacist/item/AlchemistBlockItem.java b/src/main/java/io/github/unix_supremacist/item/AlchemistBlockItem.java index 0246cd8..c0b8e60 100644 --- a/src/main/java/io/github/unix_supremacist/item/AlchemistBlockItem.java +++ b/src/main/java/io/github/unix_supremacist/item/AlchemistBlockItem.java @@ -1,9 +1,9 @@ package io.github.unix_supremacist.item; +import io.github.unix_supremacist.alabli.AlabliBlockItem; import io.github.unix_supremacist.interfaces.DurablityBar; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraft.world.item.context.BlockPlaceContext; @@ -13,7 +13,7 @@ import static io.github.unix_supremacist.content.AlchemistItems.chalk; -public class AlchemistBlockItem extends BlockItem implements DurablityBar { +public class AlchemistBlockItem extends AlabliBlockItem implements DurablityBar { public AlchemistBlockItem(Block block, Properties properties) { super(block, properties); } diff --git a/src/main/java/io/github/unix_supremacist/item/AlchemistDiggerItem.java b/src/main/java/io/github/unix_supremacist/item/AlchemistDiggerItem.java index 58af05f..87bb6a2 100644 --- a/src/main/java/io/github/unix_supremacist/item/AlchemistDiggerItem.java +++ b/src/main/java/io/github/unix_supremacist/item/AlchemistDiggerItem.java @@ -1,5 +1,6 @@ package io.github.unix_supremacist.item; +import io.github.unix_supremacist.alabli.AlabliDiggerItem; import io.github.unix_supremacist.interfaces.AreaBox; import io.github.unix_supremacist.interfaces.Destroyer; import io.github.unix_supremacist.interfaces.DurablityBar; @@ -7,7 +8,6 @@ import net.minecraft.core.Direction; import net.minecraft.tags.TagKey; import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.item.DiggerItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; import net.minecraft.world.item.Tier; @@ -18,7 +18,7 @@ import java.util.ArrayList; -public class AlchemistDiggerItem extends DiggerItem implements AreaBox, Destroyer, DurablityBar { +public class AlchemistDiggerItem extends AlabliDiggerItem implements AreaBox, Destroyer, DurablityBar { public AlchemistDiggerItem(float f, float g, Tier tier, TagKey tagKey, Properties properties) { super(f, g, tier, tagKey, properties); } diff --git a/src/main/java/io/github/unix_supremacist/item/GaleItem.java b/src/main/java/io/github/unix_supremacist/item/GaleItem.java index 5981d51..8dd1d86 100644 --- a/src/main/java/io/github/unix_supremacist/item/GaleItem.java +++ b/src/main/java/io/github/unix_supremacist/item/GaleItem.java @@ -1,17 +1,17 @@ package io.github.unix_supremacist.item; import dev.emi.trinkets.api.SlotReference; -import dev.emi.trinkets.api.TrinketItem; import io.github.ladysnake.pal.AbilitySource; import io.github.ladysnake.pal.Pal; import io.github.ladysnake.pal.VanillaAbilities; import io.github.unix_supremacist.Alchemist; +import io.github.unix_supremacist.alabli.AlabliTrinketItem; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Rarity; -public class GaleItem extends TrinketItem { +public class GaleItem extends AlabliTrinketItem { public GaleItem(Properties properties) { super(properties); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ba681e3..659a500 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -12,7 +12,7 @@ ], "contact": { "homepage": "https://unix-supremacist.github.io", - "sources": "https://github.com/unix-supremacist/alchemist" + "sources": "https://github.com/Refabricated-Mods/alchemist" }, "license": "OSL-3.0", "icon": "assets/alchemist/icon.png", @@ -30,7 +30,7 @@ }, "depends": { "fabricloader": ">=0.15.0", - "minecraft": ">=1.20", + "minecraft": ">=1.18", "java": ">=17", "fabric-api": "*", "trinkets": "*",