diff --git a/build.gradle b/build.gradle index 8695d16..33b8859 100644 --- a/build.gradle +++ b/build.gradle @@ -33,6 +33,10 @@ runs { ext { resourceReplaceProperties = [ arnicalib_version_range: arnicalib_version_range, + lib_mod_id : lib_mod_id, + lib_mod_name : lib_mod_name, + lib_mod_authors : lib_mod_authors, + lib_mod_description : lib_mod_description ] } diff --git a/gradle.properties b/gradle.properties index f4590da..c0fa370 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,3 +27,8 @@ mod_license=GNU GPLv3 mod_authors=WakelessSloth56, LainIO24, Libellule505 mod_credits=AUIOC mod_description=HarmonicEnchantments + +lib_mod_id=harmoniclib +lib_mod_name=HarmonicLib +lib_mod_authors=WakelessSloth56, LainIO24 +lib_mod_description=HarmonicLib diff --git a/src/main/java/org/auioc/mcmod/harmonicench/Initialization.java b/src/main/java/org/auioc/mcmod/harmonicench/HEInitialization.java similarity index 53% rename from src/main/java/org/auioc/mcmod/harmonicench/Initialization.java rename to src/main/java/org/auioc/mcmod/harmonicench/HEInitialization.java index 248ed43..17213e0 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/Initialization.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/HEInitialization.java @@ -19,35 +19,22 @@ package org.auioc.mcmod.harmonicench; -import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.config.ModConfig; -import net.neoforged.fml.loading.FMLEnvironment; -import net.neoforged.neoforge.common.NeoForge; -import org.auioc.mcmod.harmonicench.client.ClientInitialization; -import org.auioc.mcmod.harmonicench.common.config.HECommonConfig; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; -import org.auioc.mcmod.harmonicench.common.event.HECommonEventHandler; -import org.auioc.mcmod.harmonicench.common.mobeffect.HEMobEffects; -import org.auioc.mcmod.harmonicench.server.advancement.EnchantmentPerformancePredicates; -import org.auioc.mcmod.harmonicench.server.advancement.HECriteriaTriggers; -import org.auioc.mcmod.harmonicench.server.event.HEServerEventHandler; +import org.auioc.mcmod.harmonicench.advancement.HEEPerformancePredicates; +import org.auioc.mcmod.harmonicench.config.HECommonConfig; +import org.auioc.mcmod.harmonicench.effect.HEMobEffects; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; -public final class Initialization { +public final class HEInitialization { public static void init() { registerConfig(); modSetup(); - forgeSetup(); - - if (FMLEnvironment.dist == Dist.CLIENT) { - ClientInitialization.init(); - } } private static final IEventBus modEventBus = HarmonicEnchantments.getModEventBus(); - private static final IEventBus forgeEventBus = NeoForge.EVENT_BUS; public static void registerConfig() { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, HECommonConfig.CONFIG); @@ -56,13 +43,7 @@ public static void registerConfig() { private static void modSetup() { HEEnchantments.ENCHANTMENTS.register(modEventBus); HEMobEffects.MOB_EFFECTS.register(modEventBus); - EnchantmentPerformancePredicates.init(modEventBus); - HECriteriaTriggers.TRIGGERS.register(modEventBus); - } - - private static void forgeSetup() { - forgeEventBus.register(HECommonEventHandler.class); - forgeEventBus.register(HEServerEventHandler.class); + HEEPerformancePredicates.EPPT.register(modEventBus); } } diff --git a/src/main/java/org/auioc/mcmod/harmonicench/HarmonicEnchantments.java b/src/main/java/org/auioc/mcmod/harmonicench/HarmonicEnchantments.java index fd2a78b..6709240 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/HarmonicEnchantments.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/HarmonicEnchantments.java @@ -41,7 +41,7 @@ public final class HarmonicEnchantments implements IHMod { public HarmonicEnchantments(IEventBus modEventBus) { HarmonicEnchantments.modEventBus = modEventBus; IHMod.validateVersion(BUILD_INFO, LOGGER); - Initialization.init(); + HEInitialization.init(); } public static IEventBus getModEventBus() { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/advancement/HEEPerformancePredicates.java b/src/main/java/org/auioc/mcmod/harmonicench/advancement/HEEPerformancePredicates.java new file mode 100644 index 0000000..f2848f3 --- /dev/null +++ b/src/main/java/org/auioc/mcmod/harmonicench/advancement/HEEPerformancePredicates.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2024 AUIOC.ORG + * + * This file is part of HarmonicEnchantments, a mod made for Minecraft. + * + * ArnicaLib is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +package org.auioc.mcmod.harmonicench.advancement; + +import com.mojang.serialization.Codec; +import net.neoforged.neoforge.registries.DeferredHolder; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.auioc.mcmod.harmonicench.HarmonicEnchantments; +import org.auioc.mcmod.harmonicench.enchantment.impl.AimEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.CurseOfRebellingEnchantment; +import org.auioc.mcmod.harmoniclib.advancement.predicate.HEPerformancePredicateType; +import org.auioc.mcmod.harmoniclib.advancement.predicate.IHEPerformancePredicate; +import org.auioc.mcmod.harmoniclib.core.HLRegistries; + +public class HEEPerformancePredicates { + + public static final DeferredRegister EPPT = DeferredRegister.create(HLRegistries.ENCHANTMENT_PERFORMANCE_PREDICATE_TYPE, HarmonicEnchantments.MOD_ID); + + // ============================================================================================================== // + + private static DeferredHolder register(String id, Codec codec) { + return EPPT.register(id, () -> new HEPerformancePredicateType(codec)); + } + + public static DeferredHolder AIM = register("aim", AimEnchantment.PerformancePredicate.CODEC); + public static DeferredHolder CURSE_OF_REBELLING = register("curse_of_rebelling", CurseOfRebellingEnchantment.PerformancePredicate.CODEC); + + +} diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/config/HECommonConfig.java b/src/main/java/org/auioc/mcmod/harmonicench/config/HECommonConfig.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/common/config/HECommonConfig.java rename to src/main/java/org/auioc/mcmod/harmonicench/config/HECommonConfig.java index bfb11cd..d20c733 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/config/HECommonConfig.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/config/HECommonConfig.java @@ -17,13 +17,13 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.config; +package org.auioc.mcmod.harmonicench.config; import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.common.ModConfigSpec; import net.neoforged.neoforge.registries.DeferredHolder; -import org.auioc.mcmod.harmonicench.api.enchantment.HEEnchantmentManager; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.HEEnchantmentManager; import java.util.Comparator; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/damagesource/HEDamageTypes.java b/src/main/java/org/auioc/mcmod/harmonicench/damagesource/HEDamageTypes.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/common/damagesource/HEDamageTypes.java rename to src/main/java/org/auioc/mcmod/harmonicench/damagesource/HEDamageTypes.java index effc78d..3d65581 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/damagesource/HEDamageTypes.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/damagesource/HEDamageTypes.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.damagesource; +package org.auioc.mcmod.harmonicench.damagesource; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; import net.minecraft.core.registries.Registries; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/datagen/HEDataGenerators.java b/src/main/java/org/auioc/mcmod/harmonicench/datagen/HEDataGenerators.java index 8620a1c..48120b6 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/datagen/HEDataGenerators.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/datagen/HEDataGenerators.java @@ -26,7 +26,7 @@ import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; import net.neoforged.neoforge.data.event.GatherDataEvent; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.common.damagesource.HEDamageTypes; +import org.auioc.mcmod.harmonicench.damagesource.HEDamageTypes; import org.auioc.mcmod.harmonicench.datagen.provider.HEAdvancementProvider; import org.auioc.mcmod.harmonicench.datagen.provider.HEDamageTypeTagsProvider; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/datagen/data/HEAdvancements.java b/src/main/java/org/auioc/mcmod/harmonicench/datagen/data/HEAdvancements.java index 118ef00..a30347e 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/datagen/data/HEAdvancements.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/datagen/data/HEAdvancements.java @@ -60,11 +60,11 @@ import org.auioc.mcmod.arnicalib.game.loot.predicate.EntityAttributeCondition; import org.auioc.mcmod.arnicalib.game.tag.HEntityTypeTags; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.AimEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.CurseOfRebellingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.ProficiencyEnchantment; -import org.auioc.mcmod.harmonicench.server.advancement.criterion.EnchantmentPerformedTrigger; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmonicench.enchantment.impl.AimEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.CurseOfRebellingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.ProficiencyEnchantment; +import org.auioc.mcmod.harmoniclib.advancement.criterion.EnchantmentPerformedTrigger; import java.util.List; import java.util.Optional; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/datagen/provider/HEDamageTypeTagsProvider.java b/src/main/java/org/auioc/mcmod/harmonicench/datagen/provider/HEDamageTypeTagsProvider.java index 661735d..46979bb 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/datagen/provider/HEDamageTypeTagsProvider.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/datagen/provider/HEDamageTypeTagsProvider.java @@ -26,7 +26,7 @@ import net.minecraft.tags.DamageTypeTags; import net.neoforged.neoforge.common.data.ExistingFileHelper; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.common.damagesource.HEDamageTypes; +import org.auioc.mcmod.harmonicench.damagesource.HEDamageTypes; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/HEMobEffects.java b/src/main/java/org/auioc/mcmod/harmonicench/effect/HEMobEffects.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/HEMobEffects.java rename to src/main/java/org/auioc/mcmod/harmonicench/effect/HEMobEffects.java index 58fcd6b..6575f80 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/HEMobEffects.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/effect/HEMobEffects.java @@ -17,15 +17,15 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.mobeffect; +package org.auioc.mcmod.harmonicench.effect; import net.minecraft.core.registries.Registries; import net.minecraft.world.effect.MobEffect; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.common.mobeffect.impl.ConfusionMobEffect; -import org.auioc.mcmod.harmonicench.common.mobeffect.impl.WeightlessnessMobEffect; +import org.auioc.mcmod.harmonicench.effect.impl.ConfusionMobEffect; +import org.auioc.mcmod.harmonicench.effect.impl.WeightlessnessMobEffect; import java.util.function.Supplier; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/impl/ConfusionMobEffect.java b/src/main/java/org/auioc/mcmod/harmonicench/effect/impl/ConfusionMobEffect.java similarity index 92% rename from src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/impl/ConfusionMobEffect.java rename to src/main/java/org/auioc/mcmod/harmonicench/effect/impl/ConfusionMobEffect.java index 77a74f1..c71ff64 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/impl/ConfusionMobEffect.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/effect/impl/ConfusionMobEffect.java @@ -17,14 +17,14 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.mobeffect.impl; +package org.auioc.mcmod.harmonicench.effect.impl; -import org.auioc.mcmod.arnicalib.game.input.InputUtils; -import org.auioc.mcmod.harmonicench.api.effect.IMovementInputMobEffect; import net.minecraft.client.player.Input; import net.minecraft.client.player.LocalPlayer; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; +import org.auioc.mcmod.arnicalib.game.input.InputUtils; +import org.auioc.mcmod.harmoniclib.effect.IMovementInputMobEffect; public class ConfusionMobEffect extends MobEffect implements IMovementInputMobEffect { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/impl/WeightlessnessMobEffect.java b/src/main/java/org/auioc/mcmod/harmonicench/effect/impl/WeightlessnessMobEffect.java similarity index 92% rename from src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/impl/WeightlessnessMobEffect.java rename to src/main/java/org/auioc/mcmod/harmonicench/effect/impl/WeightlessnessMobEffect.java index 1866acd..3b30b5b 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/mobeffect/impl/WeightlessnessMobEffect.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/effect/impl/WeightlessnessMobEffect.java @@ -17,14 +17,14 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.mobeffect.impl; +package org.auioc.mcmod.harmonicench.effect.impl; -import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils; -import org.auioc.mcmod.harmonicench.common.mobeffect.HEMobEffects; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.phys.Vec3; +import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils; +import org.auioc.mcmod.harmonicench.effect.HEMobEffects; public class WeightlessnessMobEffect extends MobEffect { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/HEEnchantments.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/HEEnchantments.java similarity index 71% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/HEEnchantments.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/HEEnchantments.java index ed62494..2d3efc0 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/HEEnchantments.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/HEEnchantments.java @@ -17,36 +17,36 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment; +package org.auioc.mcmod.harmonicench.enchantment; import net.minecraft.core.registries.Registries; import net.minecraft.world.item.enchantment.Enchantment; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.AimEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.BaneOfChampionsEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.BlessingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.BluntEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.CurseOfRebellingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.CurseOfSacrificingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.DeepStudyEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.DiningEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.EfficacyEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.ElectrificationEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.ForgingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.FreeRidingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.HandinessEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.IceAspectEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.LongEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.LuckOfTheSnowEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.MobAffinityEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.ProficiencyEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.RapierEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.SafeTeleportingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.SiphoningEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.SnipingEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.SunAffinityEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.AimEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.BaneOfChampionsEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.BlessingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.BluntEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.CurseOfRebellingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.CurseOfSacrificingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.DeepStudyEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.DiningEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.EfficacyEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.ElectrificationEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.ForgingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.FreeRidingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.HandinessEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.IceAspectEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.LongEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.LuckOfTheSnowEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.MobAffinityEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.ProficiencyEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.RapierEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.SafeTeleportingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.SiphoningEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.SnipingEnchantment; +import org.auioc.mcmod.harmonicench.enchantment.impl.SunAffinityEnchantment; import java.util.function.Supplier; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/AimEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/AimEnchantment.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/AimEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/AimEnchantment.java index 6be17b8..c2301da 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/AimEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/AimEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; @@ -42,13 +42,13 @@ import org.auioc.mcmod.arnicalib.base.math.MathUtil; import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; import org.auioc.mcmod.arnicalib.game.world.phys.RayCastUtils; -import org.auioc.mcmod.harmonicench.api.advancement.EPPredicateType; -import org.auioc.mcmod.harmonicench.api.advancement.IEnchantmentPerformancePredicate; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IPlayerEnchantment; -import org.auioc.mcmod.harmonicench.server.advancement.EnchantmentPerformancePredicates; -import org.auioc.mcmod.harmonicench.server.advancement.HECriteriaTriggers; +import org.auioc.mcmod.harmonicench.advancement.HEEPerformancePredicates; +import org.auioc.mcmod.harmoniclib.advancement.HLCriteriaTriggers; +import org.auioc.mcmod.harmoniclib.advancement.predicate.HEPerformancePredicateType; +import org.auioc.mcmod.harmoniclib.advancement.predicate.IHEPerformancePredicate; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IPlayerEnchantment; import java.util.Optional; @@ -111,7 +111,7 @@ public void onPlayerTick(int lvl, ItemStack itemStack, EquipmentSlot slot, Playe } private void triggerAdvancement(ServerPlayer player, ItemStack itemStack, LivingEntity aimedEntity) { - HECriteriaTriggers.ENCHANTMENT_PERFORMED.get().trigger( + HLCriteriaTriggers.ENCHANTMENT_PERFORMED.get().trigger( player, this, itemStack, (PerformancePredicate p) -> p.matches(player, aimedEntity) ); @@ -119,7 +119,7 @@ private void triggerAdvancement(ServerPlayer player, ItemStack itemStack, Living // ============================================================================================================== // - public record PerformancePredicate(Optional aimedEntity, Optional distance) implements IEnchantmentPerformancePredicate { + public record PerformancePredicate(Optional aimedEntity, Optional distance) implements IHEPerformancePredicate { public PerformancePredicate(EntityPredicate aimedEntityPredicate) { this(Optional.of(EntityPredicate.wrap(aimedEntityPredicate)), Optional.empty()); @@ -137,8 +137,8 @@ public boolean matches(ServerPlayer player, LivingEntity aimedLiving) { // ========================================================================================================== // @Override - public EPPredicateType getType() { - return EnchantmentPerformancePredicates.AIM.get(); + public HEPerformancePredicateType getType() { + return HEEPerformancePredicates.AIM.get(); } public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BaneOfChampionsEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BaneOfChampionsEnchantment.java similarity index 91% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BaneOfChampionsEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BaneOfChampionsEnchantment.java index 0c8fb68..3ded983 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BaneOfChampionsEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BaneOfChampionsEnchantment.java @@ -17,10 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; @@ -29,6 +27,8 @@ import net.minecraft.world.item.enchantment.DamageEnchantment; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; public class BaneOfChampionsEnchantment extends AbstractHEEnchantment implements ILivingEnchantment.Hurt { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BlessingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BlessingEnchantment.java similarity index 91% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BlessingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BlessingEnchantment.java index fa8d809..d492358 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BlessingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BlessingEnchantment.java @@ -17,12 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageTypes; import net.minecraft.world.entity.EquipmentSlot; @@ -33,6 +29,10 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.EnchantmentHelper; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; public class BlessingEnchantment extends AbstractHEEnchantment implements IItemEnchantment.Protection { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BluntEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BluntEnchantment.java similarity index 89% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BluntEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BluntEnchantment.java index fd34752..c46f9e5 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/BluntEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/BluntEnchantment.java @@ -17,19 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import java.util.Map; -import java.util.UUID; - -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; -import org.auioc.mcmod.arnicalib.game.tag.HItemTags; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IAttributeModifierEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IPlayerEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; -import org.auioc.mcmod.harmonicench.common.mobeffect.HEMobEffects; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EquipmentSlot; @@ -41,6 +30,17 @@ import net.minecraft.world.item.SwordItem; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; +import org.auioc.mcmod.arnicalib.game.tag.HItemTags; +import org.auioc.mcmod.harmonicench.effect.HEMobEffects; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IAttributeModifierEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IPlayerEnchantment; + +import java.util.Map; +import java.util.UUID; public class BluntEnchantment extends AbstractHEEnchantment implements IAttributeModifierEnchantment, IPlayerEnchantment.CriticalHit { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/CurseOfRebellingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/CurseOfRebellingEnchantment.java similarity index 83% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/CurseOfRebellingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/CurseOfRebellingEnchantment.java index 0f34fc4..5eb6b1a 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/CurseOfRebellingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/CurseOfRebellingEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; @@ -33,14 +33,14 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import org.auioc.mcmod.arnicalib.game.random.GameRandomUtils; -import org.auioc.mcmod.harmonicench.api.advancement.EPPredicateType; -import org.auioc.mcmod.harmonicench.api.advancement.IEnchantmentPerformancePredicate; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.common.damagesource.HEDamageTypes; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; -import org.auioc.mcmod.harmonicench.server.advancement.EnchantmentPerformancePredicates; -import org.auioc.mcmod.harmonicench.server.advancement.HECriteriaTriggers; +import org.auioc.mcmod.harmonicench.damagesource.HEDamageTypes; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmonicench.advancement.HEEPerformancePredicates; +import org.auioc.mcmod.harmoniclib.advancement.HLCriteriaTriggers; +import org.auioc.mcmod.harmoniclib.advancement.predicate.HEPerformancePredicateType; +import org.auioc.mcmod.harmoniclib.advancement.predicate.IHEPerformancePredicate; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; import java.util.Optional; @@ -94,7 +94,7 @@ public int onItemHurt(int lvl, ItemStack itemStack, int damage, RandomSource ran } private void triggerAdvancement(ServerPlayer player, ItemStack itemStack, boolean isDead) { - HECriteriaTriggers.ENCHANTMENT_PERFORMED.get().trigger( + HLCriteriaTriggers.ENCHANTMENT_PERFORMED.get().trigger( player, this, itemStack, (PerformancePredicate p) -> p.matches(isDead) ); @@ -123,7 +123,7 @@ public Component getLocalizedDeathMessage(LivingEntity living) { // ============================================================================================================== // - public record PerformancePredicate(Optional isDead) implements IEnchantmentPerformancePredicate { + public record PerformancePredicate(Optional isDead) implements IHEPerformancePredicate { public boolean matches(boolean isDead) { return isDead().isEmpty() || isDead().get() == isDead; @@ -132,8 +132,8 @@ public boolean matches(boolean isDead) { // ========================================================================================================== // @Override - public EPPredicateType getType() { - return EnchantmentPerformancePredicates.CURSE_OF_REBELLING.get(); + public HEPerformancePredicateType getType() { + return HEEPerformancePredicates.CURSE_OF_REBELLING.get(); } public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/CurseOfSacrificingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/CurseOfSacrificingEnchantment.java similarity index 93% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/CurseOfSacrificingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/CurseOfSacrificingEnchantment.java index b603ae8..6ee7b89 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/CurseOfSacrificingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/CurseOfSacrificingEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; @@ -36,10 +36,10 @@ import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; import org.auioc.mcmod.arnicalib.game.enchantment.EnchantmentTagUtils; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; -import org.auioc.mcmod.harmonicench.utils.EnchantmentHelper; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentHelper; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/DeepStudyEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/DeepStudyEnchantment.java similarity index 91% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/DeepStudyEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/DeepStudyEnchantment.java index 179baf9..1596acf 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/DeepStudyEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/DeepStudyEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; @@ -27,8 +27,8 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.neoforged.neoforge.common.Tags; import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILootBonusEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILootBonusEnchantment; public class DeepStudyEnchantment extends AbstractHEEnchantment implements ILootBonusEnchantment.ApplyBonusCountFunction { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/DiningEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/DiningEnchantment.java similarity index 90% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/DiningEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/DiningEnchantment.java index bb65cb8..79fadd1 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/DiningEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/DiningEnchantment.java @@ -17,18 +17,18 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.apache.commons.lang3.tuple.Pair; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IPlayerEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; +import org.apache.commons.lang3.tuple.Pair; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IPlayerEnchantment; public class DiningEnchantment extends AbstractHEEnchantment implements IPlayerEnchantment.Eat { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/EfficacyEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/EfficacyEnchantment.java similarity index 94% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/EfficacyEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/EfficacyEnchantment.java index 40d8a9f..733c73a 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/EfficacyEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/EfficacyEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; @@ -35,9 +35,9 @@ import org.auioc.mcmod.arnicalib.base.math.MathUtil; import org.auioc.mcmod.arnicalib.game.entity.projectile.ITippedArrow; import org.auioc.mcmod.arnicalib.mod.mixin.common.MixinAccessorMobEffectInstance; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IProjectileEnchantment; -import org.auioc.mcmod.harmonicench.api.mixin.common.IMixinSpectralArrow; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IProjectileEnchantment; +import org.auioc.mcmod.harmoniclib.mixinapi.IMixinSpectralArrow; import java.util.HashSet; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ElectrificationEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ElectrificationEnchantment.java similarity index 93% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ElectrificationEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ElectrificationEnchantment.java index b2ff87e..72439e2 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ElectrificationEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ElectrificationEnchantment.java @@ -17,12 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.game.random.GameRandomUtils; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.effect.MobEffectInstance; @@ -36,6 +32,10 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.level.Level; +import org.auioc.mcmod.arnicalib.game.random.GameRandomUtils; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; public class ElectrificationEnchantment extends AbstractHEEnchantment implements IItemEnchantment.Tick.Inventory, ILivingEnchantment.Hurt { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ForgingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ForgingEnchantment.java similarity index 92% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ForgingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ForgingEnchantment.java index ee2ed64..e5f111f 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ForgingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ForgingEnchantment.java @@ -17,16 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import java.util.Map; -import java.util.UUID; -import javax.annotation.Nullable; - -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IAttributeModifierEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; @@ -37,6 +29,14 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IAttributeModifierEnchantment; + +import javax.annotation.Nullable; +import java.util.Map; +import java.util.UUID; public class ForgingEnchantment extends AbstractHEEnchantment implements IAttributeModifierEnchantment { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/FreeRidingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/FreeRidingEnchantment.java similarity index 90% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/FreeRidingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/FreeRidingEnchantment.java index 334e3eb..595b9a8 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/FreeRidingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/FreeRidingEnchantment.java @@ -17,17 +17,17 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; import net.minecraft.server.level.ServerPlayer; import net.minecraft.util.RandomSource; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; public class FreeRidingEnchantment extends AbstractHEEnchantment implements IItemEnchantment.Hurt { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/HandinessEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/HandinessEnchantment.java similarity index 92% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/HandinessEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/HandinessEnchantment.java index 88c5b54..c861bd7 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/HandinessEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/HandinessEnchantment.java @@ -17,11 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IProjectileEnchantment; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.EquipmentSlot; @@ -31,6 +28,9 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.phys.Vec3; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IProjectileEnchantment; public class HandinessEnchantment extends AbstractHEEnchantment implements IProjectileEnchantment.HurtLiving { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/IceAspectEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/IceAspectEnchantment.java similarity index 91% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/IceAspectEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/IceAspectEnchantment.java index 5d12b49..8e3d349 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/IceAspectEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/IceAspectEnchantment.java @@ -17,17 +17,17 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; public class IceAspectEnchantment extends AbstractHEEnchantment implements ILivingEnchantment.Hurt { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/LongEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/LongEnchantment.java similarity index 89% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/LongEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/LongEnchantment.java index ea2ce05..87736df 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/LongEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/LongEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; @@ -28,9 +28,9 @@ import net.minecraft.world.item.enchantment.Enchantments; import net.neoforged.neoforge.common.NeoForgeMod; import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IAttributeModifierEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IAttributeModifierEnchantment; import java.util.Map; import java.util.UUID; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/LuckOfTheSnowEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/LuckOfTheSnowEnchantment.java similarity index 91% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/LuckOfTheSnowEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/LuckOfTheSnowEnchantment.java index d54ff37..9c4613f 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/LuckOfTheSnowEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/LuckOfTheSnowEnchantment.java @@ -17,17 +17,17 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.apache.commons.lang3.tuple.Pair; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; +import org.apache.commons.lang3.tuple.Pair; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; public class LuckOfTheSnowEnchantment extends AbstractHEEnchantment implements IItemEnchantment.FishingRod { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/MobAffinityEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/MobAffinityEnchantment.java similarity index 94% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/MobAffinityEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/MobAffinityEnchantment.java index 8452ffc..1707664 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/MobAffinityEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/MobAffinityEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.effect.MobEffectInstance; @@ -34,8 +34,8 @@ import org.auioc.mcmod.arnicalib.game.effect.MobEffectUtils; import org.auioc.mcmod.arnicalib.game.entity.MobStance; import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; import java.util.LinkedHashMap; import java.util.function.BiPredicate; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ProficiencyEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ProficiencyEnchantment.java similarity index 92% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ProficiencyEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ProficiencyEnchantment.java index 6d0594e..716c732 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/ProficiencyEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/ProficiencyEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; @@ -34,10 +34,10 @@ import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IBlockEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.utils.EnchantmentHelper; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IBlockEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentHelper; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/RapierEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/RapierEnchantment.java similarity index 87% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/RapierEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/RapierEnchantment.java index 992598a..79cd169 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/RapierEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/RapierEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; @@ -30,10 +30,10 @@ import net.neoforged.neoforge.common.ToolAction; import net.neoforged.neoforge.common.ToolActions; import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IAttributeModifierEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IToolActionControllerEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IAttributeModifierEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IToolActionControllerEnchantment; import java.util.Map; import java.util.UUID; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SafeTeleportingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SafeTeleportingEnchantment.java similarity index 85% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SafeTeleportingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SafeTeleportingEnchantment.java index 60ef342..b99643a 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SafeTeleportingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SafeTeleportingEnchantment.java @@ -17,10 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.EquipmentSlot; @@ -28,10 +26,13 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.event.HLServerEventHandler; /** - * @see org.auioc.mcmod.harmonicench.server.event.HEServerEventHandler#onEnderPearlTeleport - * @see org.auioc.mcmod.harmonicench.server.event.HEServerEventHandler#onEntityTravelToDimension + * @see HLServerEventHandler#onEnderPearlTeleport + * @see HLServerEventHandler#onEntityTravelToDimension */ public class SafeTeleportingEnchantment extends AbstractHEEnchantment { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SiphoningEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SiphoningEnchantment.java similarity index 92% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SiphoningEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SiphoningEnchantment.java index fcedf40..0aaa7a8 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SiphoningEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SiphoningEnchantment.java @@ -17,11 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; @@ -31,6 +28,9 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; public class SiphoningEnchantment extends AbstractHEEnchantment implements ILivingEnchantment.Death { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SnipingEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SnipingEnchantment.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SnipingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SnipingEnchantment.java index 3b41665..6cb3c73 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SnipingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SnipingEnchantment.java @@ -17,13 +17,8 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; -import org.auioc.mcmod.arnicalib.base.math.MathUtil; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IProjectileEnchantment; -import org.auioc.mcmod.harmonicench.api.mixin.common.IMixinAbstractArrow; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; import net.minecraft.util.Mth; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; @@ -33,6 +28,11 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraft.world.phys.Vec3; +import org.auioc.mcmod.arnicalib.base.math.MathUtil; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IProjectileEnchantment; +import org.auioc.mcmod.harmoniclib.mixinapi.IMixinAbstractArrow; public class SnipingEnchantment extends AbstractHEEnchantment implements IProjectileEnchantment.HurtLiving, IProjectileEnchantment.AbstractArrow { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SunAffinityEnchantment.java b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SunAffinityEnchantment.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SunAffinityEnchantment.java rename to src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SunAffinityEnchantment.java index ed4918e..02875a7 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/enchantment/impl/SunAffinityEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmonicench/enchantment/impl/SunAffinityEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.enchantment.impl; +package org.auioc.mcmod.harmonicench.enchantment.impl; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.entity.EquipmentSlot; @@ -28,10 +28,10 @@ import net.neoforged.fml.LogicalSide; import net.neoforged.neoforge.event.TickEvent; import org.auioc.mcmod.arnicalib.game.enchantment.HEnchantmentCategory; -import org.auioc.mcmod.harmonicench.api.enchantment.AbstractHEEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IPlayerEnchantment; -import org.auioc.mcmod.harmonicench.common.mobeffect.HEMobEffects; +import org.auioc.mcmod.harmonicench.effect.HEMobEffects; +import org.auioc.mcmod.harmoniclib.enchantment.api.AbstractHEEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IPlayerEnchantment; public class SunAffinityEnchantment extends AbstractHEEnchantment implements IItemEnchantment.Elytra, IPlayerEnchantment.Tick { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/EnchantmentPerformancePredicates.java b/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/EnchantmentPerformancePredicates.java deleted file mode 100644 index 5e8e0e8..0000000 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/EnchantmentPerformancePredicates.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2024 AUIOC.ORG - * - * This file is part of HarmonicEnchantments, a mod made for Minecraft. - * - * ArnicaLib is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - */ - -package org.auioc.mcmod.harmonicench.server.advancement; - -import com.mojang.serialization.Codec; -import net.minecraft.core.Registry; -import net.minecraft.resources.ResourceKey; -import net.minecraft.util.ExtraCodecs; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.neoforge.registries.DeferredHolder; -import net.neoforged.neoforge.registries.DeferredRegister; -import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.api.advancement.EPPredicateType; -import org.auioc.mcmod.harmonicench.api.advancement.IEnchantmentPerformancePredicate; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.AimEnchantment; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.CurseOfRebellingEnchantment; - -public class EnchantmentPerformancePredicates { - - public static final ResourceKey> KEY = ResourceKey.createRegistryKey(HarmonicEnchantments.id("epp")); - - private static final DeferredRegister EPP = DeferredRegister.create(KEY, HarmonicEnchantments.MOD_ID); - - private static final Registry REGISTRY = EPP.makeRegistry(builder -> { }); - - public static final Codec CODEC = ExtraCodecs.lazyInitializedCodec(() -> - REGISTRY.byNameCodec().dispatch("performance", IEnchantmentPerformancePredicate::getType, EPPredicateType::codec) - ); - - public static void init(IEventBus modEventBus) { - EPP.register(modEventBus); - } - - // ============================================================================================================== // - - private static DeferredHolder register(String id, Codec codec) { - return EPP.register(id, () -> new EPPredicateType(codec)); - } - - public static DeferredHolder AIM = register("aim", AimEnchantment.PerformancePredicate.CODEC); - public static DeferredHolder CURSE_OF_REBELLING = register("curse_of_rebelling", CurseOfRebellingEnchantment.PerformancePredicate.CODEC); - - -} diff --git a/src/main/java/org/auioc/mcmod/harmoniclib/HLInitialization.java b/src/main/java/org/auioc/mcmod/harmoniclib/HLInitialization.java new file mode 100644 index 0000000..7f8da94 --- /dev/null +++ b/src/main/java/org/auioc/mcmod/harmoniclib/HLInitialization.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2024 AUIOC.ORG + * + * This file is part of HarmonicEnchantments, a mod made for Minecraft. + * + * ArnicaLib is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +package org.auioc.mcmod.harmoniclib; + +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.common.NeoForge; +import org.auioc.mcmod.harmoniclib.advancement.HLCriteriaTriggers; +import org.auioc.mcmod.harmoniclib.client.HLClientInitialization; +import org.auioc.mcmod.harmoniclib.core.HLRegistries; +import org.auioc.mcmod.harmoniclib.event.HLCommonEventHandler; +import org.auioc.mcmod.harmoniclib.event.HLServerEventHandler; + +public final class HLInitialization { + + public static void init() { + modSetup(); + forgeSetup(); + + if (FMLEnvironment.dist == Dist.CLIENT) { + HLClientInitialization.init(); + } + } + + private static final IEventBus modEventBus = HarmonicLib.getModEventBus(); + private static final IEventBus forgeEventBus = NeoForge.EVENT_BUS; + + private static void forgeSetup() { + forgeEventBus.register(HLCommonEventHandler.class); + forgeEventBus.register(HLServerEventHandler.class); + } + + private static void modSetup() { + HLCriteriaTriggers.TRIGGERS.register(modEventBus); + HLRegistries.init(modEventBus); + } + +} diff --git a/src/main/java/org/auioc/mcmod/harmoniclib/HarmonicLib.java b/src/main/java/org/auioc/mcmod/harmoniclib/HarmonicLib.java new file mode 100644 index 0000000..b01aa41 --- /dev/null +++ b/src/main/java/org/auioc/mcmod/harmoniclib/HarmonicLib.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2024 AUIOC.ORG + * + * This file is part of HarmonicEnchantments, a mod made for Minecraft. + * + * ArnicaLib is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +package org.auioc.mcmod.harmoniclib; + +import net.minecraft.resources.ResourceLocation; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.common.Mod; +import org.apache.logging.log4j.Logger; +import org.auioc.mcmod.arnicalib.base.log.LogUtil; +import org.auioc.mcmod.arnicalib.game.mod.IHMod; + +@Mod(HarmonicLib.MOD_ID) +public final class HarmonicLib implements IHMod { + + public static final String MOD_ID = "harmoniclib"; + public static final String MOD_NAME = "HarmonicLib"; + public static final Logger LOGGER = LogUtil.getLogger(MOD_NAME); + + + private static IEventBus modEventBus; + + public HarmonicLib(IEventBus modEventBus) { + HarmonicLib.modEventBus = modEventBus; + HLInitialization.init(); + } + + public static IEventBus getModEventBus() { + return modEventBus; + } + + public static ResourceLocation id(String path) { + return new ResourceLocation(MOD_ID, path); + } + +} diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/HECriteriaTriggers.java b/src/main/java/org/auioc/mcmod/harmoniclib/advancement/HLCriteriaTriggers.java similarity index 85% rename from src/main/java/org/auioc/mcmod/harmonicench/server/advancement/HECriteriaTriggers.java rename to src/main/java/org/auioc/mcmod/harmoniclib/advancement/HLCriteriaTriggers.java index af0cf1c..3b60558 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/HECriteriaTriggers.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/advancement/HLCriteriaTriggers.java @@ -17,20 +17,20 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.server.advancement; +package org.auioc.mcmod.harmoniclib.advancement; import net.minecraft.advancements.CriterionTrigger; import net.minecraft.core.registries.Registries; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; -import org.auioc.mcmod.harmonicench.HarmonicEnchantments; -import org.auioc.mcmod.harmonicench.server.advancement.criterion.EnchantmentPerformedTrigger; +import org.auioc.mcmod.harmoniclib.HarmonicLib; +import org.auioc.mcmod.harmoniclib.advancement.criterion.EnchantmentPerformedTrigger; import java.util.function.Supplier; -public final class HECriteriaTriggers { +public final class HLCriteriaTriggers { - public static final DeferredRegister> TRIGGERS = DeferredRegister.create(Registries.TRIGGER_TYPE, HarmonicEnchantments.MOD_ID); + public static final DeferredRegister> TRIGGERS = DeferredRegister.create(Registries.TRIGGER_TYPE, HarmonicLib.MOD_ID); private static > DeferredHolder, T> register(String _id, Supplier _sup) { return TRIGGERS.register(_id, _sup); diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/criterion/EnchantmentPerformedTrigger.java b/src/main/java/org/auioc/mcmod/harmoniclib/advancement/criterion/EnchantmentPerformedTrigger.java similarity index 78% rename from src/main/java/org/auioc/mcmod/harmonicench/server/advancement/criterion/EnchantmentPerformedTrigger.java rename to src/main/java/org/auioc/mcmod/harmoniclib/advancement/criterion/EnchantmentPerformedTrigger.java index 8a3c68e..fa2bc95 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/advancement/criterion/EnchantmentPerformedTrigger.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/advancement/criterion/EnchantmentPerformedTrigger.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.server.advancement.criterion; +package org.auioc.mcmod.harmoniclib.advancement.criterion; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; @@ -31,9 +31,9 @@ import net.minecraft.util.ExtraCodecs; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; -import org.auioc.mcmod.harmonicench.api.advancement.IEnchantmentPerformancePredicate; -import org.auioc.mcmod.harmonicench.server.advancement.EnchantmentPerformancePredicates; -import org.auioc.mcmod.harmonicench.server.advancement.HECriteriaTriggers; +import org.auioc.mcmod.harmoniclib.advancement.HLCriteriaTriggers; +import org.auioc.mcmod.harmoniclib.advancement.predicate.HEPerformancePredicateType; +import org.auioc.mcmod.harmoniclib.advancement.predicate.IHEPerformancePredicate; import javax.annotation.Nullable; import java.util.Optional; @@ -43,7 +43,7 @@ public class EnchantmentPerformedTrigger extends SimpleCriterionTrigger { @SuppressWarnings("unchecked") - public

void trigger(ServerPlayer player, Enchantment enchantment, ItemStack itemStack, Predicate

performancePredicate) { + public

void trigger(ServerPlayer player, Enchantment enchantment, ItemStack itemStack, Predicate

performancePredicate) { this.trigger(player, (instance) -> ((TriggerInstance

) instance).matches(enchantment, itemStack, performancePredicate)); } @@ -52,15 +52,15 @@ public Codec codec() { return TriggerInstance.CODEC; } - public static

Criterion createCriterion( + public static

Criterion createCriterion( Optional player, Enchantment enchantment, Optional item, Optional

performance ) { - return HECriteriaTriggers.ENCHANTMENT_PERFORMED.get().createCriterion( + return HLCriteriaTriggers.ENCHANTMENT_PERFORMED.get().createCriterion( new EnchantmentPerformedTrigger.TriggerInstance<>(player, enchantment, item, performance) ); } - public static

Criterion createCriterion( + public static

Criterion createCriterion( @Nullable ContextAwarePredicate player, Enchantment enchantment, @Nullable ItemPredicate item, @Nullable P performance ) { return createCriterion(Optional.ofNullable(player), enchantment, Optional.ofNullable(item), Optional.ofNullable(performance)); @@ -68,7 +68,7 @@ public static

Criterion( + public record TriggerInstance

( Optional player, Enchantment enchantment, Optional item, @@ -85,7 +85,7 @@ public boolean matches(Enchantment enchantment, ItemStack itemStack, Predicate

. */ -package org.auioc.mcmod.harmonicench.api.advancement; +package org.auioc.mcmod.harmoniclib.advancement.predicate; import com.mojang.serialization.Codec; +import net.minecraft.util.ExtraCodecs; +import org.auioc.mcmod.harmoniclib.core.HLRegistries; + +public record HEPerformancePredicateType(Codec codec) { + + public static final Codec CODEC = ExtraCodecs.lazyInitializedCodec(() -> + HLRegistries.ENCHANTMENT_PERFORMANCE_PREDICATE_TYPE + .byNameCodec() + .dispatch("performance", IHEPerformancePredicate::getType, HEPerformancePredicateType::codec) + ); -public record EPPredicateType(Codec codec) { } diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/advancement/IEnchantmentPerformancePredicate.java b/src/main/java/org/auioc/mcmod/harmoniclib/advancement/predicate/IHEPerformancePredicate.java similarity index 84% rename from src/main/java/org/auioc/mcmod/harmonicench/api/advancement/IEnchantmentPerformancePredicate.java rename to src/main/java/org/auioc/mcmod/harmoniclib/advancement/predicate/IHEPerformancePredicate.java index 47d3883..42827af 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/advancement/IEnchantmentPerformancePredicate.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/advancement/predicate/IHEPerformancePredicate.java @@ -17,10 +17,10 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.advancement; +package org.auioc.mcmod.harmoniclib.advancement.predicate; -public interface IEnchantmentPerformancePredicate { +public interface IHEPerformancePredicate { - EPPredicateType getType(); + HEPerformancePredicateType getType(); } diff --git a/src/main/java/org/auioc/mcmod/harmonicench/client/ClientInitialization.java b/src/main/java/org/auioc/mcmod/harmoniclib/client/HLClientInitialization.java similarity index 83% rename from src/main/java/org/auioc/mcmod/harmonicench/client/ClientInitialization.java rename to src/main/java/org/auioc/mcmod/harmoniclib/client/HLClientInitialization.java index 06291c1..050d823 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/client/ClientInitialization.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/client/HLClientInitialization.java @@ -17,22 +17,21 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.client; +package org.auioc.mcmod.harmoniclib.client; import net.neoforged.api.distmarker.Dist; import net.neoforged.api.distmarker.OnlyIn; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.common.NeoForge; -import org.auioc.mcmod.harmonicench.client.event.HEClientEventHandler; +import org.auioc.mcmod.harmoniclib.client.event.HEClientEventHandler; @OnlyIn(Dist.CLIENT) -public class ClientInitialization { +public class HLClientInitialization { public static void init() { forgeSetup(); } - // private static final IEventBus modEventBus = HarmonicEnchantments.getModEventBus(); private static final IEventBus forgeEventBus = NeoForge.EVENT_BUS; private static void forgeSetup() { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/client/event/HEClientEventHandler.java b/src/main/java/org/auioc/mcmod/harmoniclib/client/event/HEClientEventHandler.java similarity index 90% rename from src/main/java/org/auioc/mcmod/harmonicench/client/event/HEClientEventHandler.java rename to src/main/java/org/auioc/mcmod/harmoniclib/client/event/HEClientEventHandler.java index 671aa4c..d1cfc37 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/client/event/HEClientEventHandler.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/client/event/HEClientEventHandler.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.client.event; +package org.auioc.mcmod.harmoniclib.client.event; import net.minecraft.client.player.LocalPlayer; import net.neoforged.api.distmarker.Dist; @@ -25,8 +25,8 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.neoforge.client.event.MovementInputUpdateEvent; import net.neoforged.neoforge.event.entity.player.ItemTooltipEvent; -import org.auioc.mcmod.harmonicench.api.effect.IMovementInputMobEffect; -import org.auioc.mcmod.harmonicench.utils.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.effect.IMovementInputMobEffect; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentPerformer; @OnlyIn(Dist.CLIENT) public final class HEClientEventHandler { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/config/NullableBooleanValue.java b/src/main/java/org/auioc/mcmod/harmoniclib/config/NullableBooleanValue.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/api/config/NullableBooleanValue.java rename to src/main/java/org/auioc/mcmod/harmoniclib/config/NullableBooleanValue.java index 9f1fb88..88ce4dd 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/config/NullableBooleanValue.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/config/NullableBooleanValue.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.config; +package org.auioc.mcmod.harmoniclib.config; import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue; import org.auioc.mcmod.arnicalib.base.holder.ObjectHolder; diff --git a/src/main/java/org/auioc/mcmod/harmoniclib/core/HLRegistries.java b/src/main/java/org/auioc/mcmod/harmoniclib/core/HLRegistries.java new file mode 100644 index 0000000..0582b1a --- /dev/null +++ b/src/main/java/org/auioc/mcmod/harmoniclib/core/HLRegistries.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2024 AUIOC.ORG + * + * This file is part of HarmonicEnchantments, a mod made for Minecraft. + * + * ArnicaLib is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation, either version 3 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ + +package org.auioc.mcmod.harmoniclib.core; + +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceKey; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import org.auioc.mcmod.harmonicench.HarmonicEnchantments; +import org.auioc.mcmod.harmoniclib.HarmonicLib; +import org.auioc.mcmod.harmoniclib.advancement.predicate.HEPerformancePredicateType; + +public class HLRegistries { + + private static final ResourceKey> EPPT_KEY = key("enchantment_performance_predicate_type"); + private static final DeferredRegister EPPT = def(EPPT_KEY); + public static final Registry ENCHANTMENT_PERFORMANCE_PREDICATE_TYPE = EPPT.makeRegistry(builder -> { }); + + // ============================================================================================================== // + + public static void init(IEventBus modEventBus) { + EPPT.register(modEventBus); + } + + private static ResourceKey> key(String id) { + return ResourceKey.createRegistryKey(HarmonicEnchantments.id(id)); + } + + private static DeferredRegister def(ResourceKey> key) { + return DeferredRegister.create(key, HarmonicLib.MOD_ID); + } + + +} diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/effect/IMovementInputMobEffect.java b/src/main/java/org/auioc/mcmod/harmoniclib/effect/IMovementInputMobEffect.java similarity index 95% rename from src/main/java/org/auioc/mcmod/harmonicench/api/effect/IMovementInputMobEffect.java rename to src/main/java/org/auioc/mcmod/harmoniclib/effect/IMovementInputMobEffect.java index ea04655..5a06ffb 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/effect/IMovementInputMobEffect.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/effect/IMovementInputMobEffect.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.effect; +package org.auioc.mcmod.harmoniclib.effect; import net.minecraft.client.player.Input; import net.minecraft.client.player.LocalPlayer; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/utils/EnchantmentHelper.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/EnchantmentHelper.java similarity index 98% rename from src/main/java/org/auioc/mcmod/harmonicench/utils/EnchantmentHelper.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/EnchantmentHelper.java index 23941fc..ebd3f9d 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/utils/EnchantmentHelper.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/EnchantmentHelper.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.utils; +package org.auioc.mcmod.harmoniclib.enchantment; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.contents.TranslatableContents; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/utils/EnchantmentPerformer.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/EnchantmentPerformer.java similarity index 95% rename from src/main/java/org/auioc/mcmod/harmonicench/utils/EnchantmentPerformer.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/EnchantmentPerformer.java index 896588a..0ae10fa 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/utils/EnchantmentPerformer.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/EnchantmentPerformer.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.utils; +package org.auioc.mcmod.harmoniclib.enchantment; import net.minecraft.core.BlockPos; import net.minecraft.network.chat.Component; @@ -60,15 +60,16 @@ import org.auioc.mcmod.arnicalib.game.enchantment.IEnchantmentAttachableObject; import org.auioc.mcmod.arnicalib.game.entity.MobStance; import org.auioc.mcmod.arnicalib.mod.mixin.common.MixinAccessorArrow; -import org.auioc.mcmod.harmonicench.api.enchantment.IAttributeModifierEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IBlockEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IConfigurableEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILivingEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.ILootBonusEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IPlayerEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IProjectileEnchantment; -import org.auioc.mcmod.harmonicench.api.enchantment.IToolActionControllerEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IAttributeModifierEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IBlockEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IConfigurableEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILivingEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.ILootBonusEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IPlayerEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IProjectileEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.api.IToolActionControllerEnchantment; +import org.auioc.mcmod.harmoniclib.mixin.server.MixinPiglinAi; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; @@ -220,7 +221,7 @@ public static int onItemHurt(ItemStack itemStack, int originalDamage, RandomSour } /** - * FMLCoreMod: harmonicench.living_entity.magic_absorb + * FMLCoreMod: harmoniclib.living_entity.magic_absorb */ public static int getDamageProtectionWithItem(Iterable items, DamageSource source) { MutableInt protection = new MutableInt(); @@ -279,7 +280,7 @@ public static Pair onPlayerEat(ServerPlayer player, ItemStack fo } /** - * @see org.auioc.mcmod.harmonicench.mixin.server.MixinPiglinAi#isWearingGold + * @see MixinPiglinAi#isWearingGold */ public static MobStance onPiglinCheckGoldArmor(LivingEntity target) { var stance = new MutableObject(MobStance.DEFAULT); diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/AbstractHEEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/AbstractHEEnchantment.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/AbstractHEEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/AbstractHEEnchantment.java index 7d02efb..2129cf0 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/AbstractHEEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/AbstractHEEnchantment.java @@ -17,17 +17,17 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; -import java.util.function.Predicate; - -import org.auioc.mcmod.arnicalib.game.enchantment.IValidSlotsVisibleEnchantment; -import org.auioc.mcmod.arnicalib.game.registry.RegistryUtils; -import org.auioc.mcmod.harmonicench.api.config.NullableBooleanValue; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; +import org.auioc.mcmod.arnicalib.game.enchantment.IValidSlotsVisibleEnchantment; +import org.auioc.mcmod.arnicalib.game.registry.RegistryUtils; +import org.auioc.mcmod.harmoniclib.config.NullableBooleanValue; + +import java.util.function.Predicate; public abstract class AbstractHEEnchantment extends Enchantment implements IValidSlotsVisibleEnchantment, IConfigurableEnchantment { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/HEEnchantmentManager.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/HEEnchantmentManager.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/HEEnchantmentManager.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/HEEnchantmentManager.java index 67ccb11..34a4af0 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/HEEnchantmentManager.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/HEEnchantmentManager.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.minecraft.resources.ResourceLocation; import net.neoforged.neoforge.common.ModConfigSpec.BooleanValue; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IAttributeModifierEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IAttributeModifierEnchantment.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IAttributeModifierEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IAttributeModifierEnchantment.java index 49db335..962fa34 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IAttributeModifierEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IAttributeModifierEnchantment.java @@ -17,17 +17,17 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Nullable; - -import org.auioc.mcmod.arnicalib.game.enchantment.IValidSlotsVisibleEnchantment; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.item.ItemStack; +import org.auioc.mcmod.arnicalib.game.enchantment.IValidSlotsVisibleEnchantment; + +import javax.annotation.Nullable; +import java.util.Map; +import java.util.Optional; public interface IAttributeModifierEnchantment extends IValidSlotsVisibleEnchantment { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IBlockEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IBlockEnchantment.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IBlockEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IBlockEnchantment.java index ec973fe..1cb0269 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IBlockEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IBlockEnchantment.java @@ -17,15 +17,15 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; - -import java.util.Optional; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.state.BlockState; +import java.util.Optional; + public class IBlockEnchantment { public static interface BreakSpeed { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IConfigurableEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IConfigurableEnchantment.java similarity index 93% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IConfigurableEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IConfigurableEnchantment.java index 679189e..4ef40ba 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IConfigurableEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IConfigurableEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; public interface IConfigurableEnchantment { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IItemEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IItemEnchantment.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IItemEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IItemEnchantment.java index 40fb8fe..b7c77e1 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IItemEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IItemEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.minecraft.network.chat.Component; import net.minecraft.server.level.ServerPlayer; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/ILivingEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/ILivingEnchantment.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/ILivingEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/ILivingEnchantment.java index a067cef..d6429ac 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/ILivingEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/ILivingEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.damagesource.DamageSource; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/ILootBonusEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/ILootBonusEnchantment.java similarity index 95% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/ILootBonusEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/ILootBonusEnchantment.java index 4f25229..69cbf1a 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/ILootBonusEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/ILootBonusEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IPlayerEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IPlayerEnchantment.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IPlayerEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IPlayerEnchantment.java index e2bc53f..543162f 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IPlayerEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IPlayerEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IProjectileEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IProjectileEnchantment.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IProjectileEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IProjectileEnchantment.java index fea6af5..77d5355 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IProjectileEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IProjectileEnchantment.java @@ -17,13 +17,13 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; -import org.auioc.mcmod.arnicalib.game.entity.projectile.ITippedArrow; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.FireworkRocketEntity; import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.phys.Vec3; +import org.auioc.mcmod.arnicalib.game.entity.projectile.ITippedArrow; public class IProjectileEnchantment { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IToolActionControllerEnchantment.java b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IToolActionControllerEnchantment.java similarity index 94% rename from src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IToolActionControllerEnchantment.java rename to src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IToolActionControllerEnchantment.java index 8a412a3..c67602c 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/enchantment/IToolActionControllerEnchantment.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/enchantment/api/IToolActionControllerEnchantment.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.enchantment; +package org.auioc.mcmod.harmoniclib.enchantment.api; import net.neoforged.neoforge.common.ToolAction; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/common/event/HECommonEventHandler.java b/src/main/java/org/auioc/mcmod/harmoniclib/event/HLCommonEventHandler.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/common/event/HECommonEventHandler.java rename to src/main/java/org/auioc/mcmod/harmoniclib/event/HLCommonEventHandler.java index 62751bc..d9fd3f0 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/common/event/HECommonEventHandler.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/event/HLCommonEventHandler.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.common.event; +package org.auioc.mcmod.harmoniclib.event; import net.minecraft.network.protocol.game.ClientboundSetHealthPacket; import net.minecraft.server.level.ServerPlayer; @@ -35,10 +35,10 @@ import org.auioc.mcmod.arnicalib.game.entity.projectile.IHProjectile; import org.auioc.mcmod.arnicalib.game.event.common.ItemInventoryTickEvent; import org.auioc.mcmod.arnicalib.game.event.common.PlayerEatEvent; -import org.auioc.mcmod.harmonicench.utils.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentPerformer; -public class HECommonEventHandler { +public class HLCommonEventHandler { @SubscribeEvent public static void onGetItemAttributeModifier(final ItemAttributeModifierEvent event) { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/event/HEServerEventFactory.java b/src/main/java/org/auioc/mcmod/harmoniclib/event/HLServerEventFactory.java similarity index 81% rename from src/main/java/org/auioc/mcmod/harmonicench/server/event/HEServerEventFactory.java rename to src/main/java/org/auioc/mcmod/harmoniclib/event/HLServerEventFactory.java index a3c774e..9731c82 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/event/HEServerEventFactory.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/event/HLServerEventFactory.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.server.event; +package org.auioc.mcmod.harmoniclib.event; import net.minecraft.world.entity.animal.Cat; import net.minecraft.world.entity.player.Player; @@ -26,15 +26,16 @@ import net.minecraft.world.level.storage.loot.LootContext; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.common.NeoForge; -import org.auioc.mcmod.harmonicench.server.event.impl.ApplyLootEnchantmentBonusCountEvent; -import org.auioc.mcmod.harmonicench.server.event.impl.CatMorningGiftEvent; +import org.auioc.mcmod.harmoniclib.event.impl.ApplyLootEnchantmentBonusCountEvent; +import org.auioc.mcmod.harmoniclib.event.impl.CatMorningGiftEvent; +import org.auioc.mcmod.harmoniclib.mixin.server.MixinCatRelaxOnOwnerGoal; -public final class HEServerEventFactory { +public final class HLServerEventFactory { private static final IEventBus BUS = NeoForge.EVENT_BUS; /** - * FMLCoreMod: harmonicench.apply_bonus_count.run + * FMLCoreMod: harmoniclib.apply_bonus_count.run */ public static int onApplyLootEnchantmentBonusCount(LootContext lootContext, ItemStack itemStack, Enchantment enchantment, int enchantmentLevel) { var event = new ApplyLootEnchantmentBonusCountEvent(lootContext, itemStack, enchantment, enchantmentLevel); @@ -43,7 +44,7 @@ public static int onApplyLootEnchantmentBonusCount(LootContext lootContext, Item } /** - * @see org.auioc.mcmod.harmonicench.mixin.server.MixinCatRelaxOnOwnerGoal#stop + * @see MixinCatRelaxOnOwnerGoal#stop */ public static boolean onCatMorningGiftConditionCheck(Cat cat, Player owner) { var event = new CatMorningGiftEvent.Check(cat, owner); diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/event/HEServerEventHandler.java b/src/main/java/org/auioc/mcmod/harmoniclib/event/HLServerEventHandler.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/server/event/HEServerEventHandler.java rename to src/main/java/org/auioc/mcmod/harmoniclib/event/HLServerEventHandler.java index b251934..034b4d5 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/event/HEServerEventHandler.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/event/HLServerEventHandler.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.server.event; +package org.auioc.mcmod.harmoniclib.event; import net.minecraft.world.entity.LivingEntity; import net.neoforged.bus.api.SubscribeEvent; @@ -28,14 +28,14 @@ import org.auioc.mcmod.arnicalib.game.event.server.FishingRodCastEvent; import org.auioc.mcmod.arnicalib.game.event.server.ItemHurtEvent; import org.auioc.mcmod.arnicalib.game.event.server.ProjectileWeaponReleaseEvent; -import org.auioc.mcmod.harmonicench.common.enchantment.HEEnchantments; -import org.auioc.mcmod.harmonicench.common.enchantment.impl.SafeTeleportingEnchantment; -import org.auioc.mcmod.harmonicench.server.event.impl.ApplyLootEnchantmentBonusCountEvent; -import org.auioc.mcmod.harmonicench.server.event.impl.CatMorningGiftEvent; -import org.auioc.mcmod.harmonicench.utils.EnchantmentHelper; -import org.auioc.mcmod.harmonicench.utils.EnchantmentPerformer; +import org.auioc.mcmod.harmonicench.enchantment.HEEnchantments; +import org.auioc.mcmod.harmonicench.enchantment.impl.SafeTeleportingEnchantment; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentHelper; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.event.impl.ApplyLootEnchantmentBonusCountEvent; +import org.auioc.mcmod.harmoniclib.event.impl.CatMorningGiftEvent; -public final class HEServerEventHandler { +public final class HLServerEventHandler { @SubscribeEvent public static void onItemHurt(final ItemHurtEvent event) { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/event/impl/ApplyLootEnchantmentBonusCountEvent.java b/src/main/java/org/auioc/mcmod/harmoniclib/event/impl/ApplyLootEnchantmentBonusCountEvent.java similarity index 97% rename from src/main/java/org/auioc/mcmod/harmonicench/server/event/impl/ApplyLootEnchantmentBonusCountEvent.java rename to src/main/java/org/auioc/mcmod/harmoniclib/event/impl/ApplyLootEnchantmentBonusCountEvent.java index 40280d7..f663504 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/event/impl/ApplyLootEnchantmentBonusCountEvent.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/event/impl/ApplyLootEnchantmentBonusCountEvent.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.server.event.impl; +package org.auioc.mcmod.harmoniclib.event.impl; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.enchantment.Enchantment; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/server/event/impl/CatMorningGiftEvent.java b/src/main/java/org/auioc/mcmod/harmoniclib/event/impl/CatMorningGiftEvent.java similarity index 98% rename from src/main/java/org/auioc/mcmod/harmonicench/server/event/impl/CatMorningGiftEvent.java rename to src/main/java/org/auioc/mcmod/harmoniclib/event/impl/CatMorningGiftEvent.java index c237572..701fc58 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/server/event/impl/CatMorningGiftEvent.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/event/impl/CatMorningGiftEvent.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.server.event.impl; +package org.auioc.mcmod.harmoniclib.event.impl; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.animal.Cat; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinAbstractArrow.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinAbstractArrow.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinAbstractArrow.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinAbstractArrow.java index 7d00247..b7f3d3d 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinAbstractArrow.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinAbstractArrow.java @@ -17,19 +17,19 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.common; +package org.auioc.mcmod.harmoniclib.mixin.common; -import org.auioc.mcmod.harmonicench.api.mixin.common.IMixinAbstractArrow; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyArg; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.world.entity.projectile.AbstractArrow; +import org.auioc.mcmod.harmoniclib.mixinapi.IMixinAbstractArrow; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(value = AbstractArrow.class) public class MixinAbstractArrow implements IMixinAbstractArrow { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinElytraItem.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinElytraItem.java similarity index 84% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinElytraItem.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinElytraItem.java index 7dedc7b..cae753c 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinElytraItem.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinElytraItem.java @@ -17,21 +17,22 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.common; +package org.auioc.mcmod.harmoniclib.mixin.common; -import org.auioc.mcmod.harmonicench.utils.EnchantmentPerformer; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ElytraItem; import net.minecraft.world.item.ItemStack; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.enchantment.api.IItemEnchantment; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; @Mixin(value = ElytraItem.class) public class MixinElytraItem { /** * @author WakelessSloth56 - * @reason {@link org.auioc.mcmod.harmonicench.api.enchantment.IItemEnchantment.Elytra#canElytraFly} + * @reason {@link IItemEnchantment.Elytra#canElytraFly} */ @Overwrite(remap = false) public boolean canElytraFly(ItemStack stack, LivingEntity entity) { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinIForgeItemStack.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinIForgeItemStack.java similarity index 84% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinIForgeItemStack.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinIForgeItemStack.java index 84960fe..98533fe 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinIForgeItemStack.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinIForgeItemStack.java @@ -17,12 +17,13 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.common; +package org.auioc.mcmod.harmoniclib.mixin.common; import net.minecraft.world.item.ItemStack; import net.neoforged.neoforge.common.ToolAction; import net.neoforged.neoforge.common.extensions.IItemStackExtension; -import org.auioc.mcmod.harmonicench.utils.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.enchantment.api.IToolActionControllerEnchantment; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -31,7 +32,7 @@ public interface MixinIForgeItemStack { /** * @author WakelessSloth56 - * @reason {@link org.auioc.mcmod.harmonicench.api.enchantment.IToolActionControllerEnchantment#canPerformAction} + * @reason {@link IToolActionControllerEnchantment#canPerformAction} */ @Overwrite default boolean canPerformAction(ToolAction toolAction) { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinProjectile.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinProjectile.java similarity index 96% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinProjectile.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinProjectile.java index 48acaa6..cd7ef5b 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinProjectile.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinProjectile.java @@ -17,23 +17,23 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.common; +package org.auioc.mcmod.harmoniclib.mixin.common; -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Nullable; - -import org.auioc.mcmod.arnicalib.game.registry.RegistryUtils; -import org.auioc.mcmod.harmonicench.api.mixin.common.IMixinProjectile; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentHelper; +import org.auioc.mcmod.arnicalib.game.registry.RegistryUtils; +import org.auioc.mcmod.harmoniclib.mixinapi.IMixinProjectile; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; @Mixin(value = Projectile.class) public class MixinProjectile implements IMixinProjectile { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinSpectralArrow.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinSpectralArrow.java similarity index 90% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinSpectralArrow.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinSpectralArrow.java index b5fa53c..3d09b24 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/common/MixinSpectralArrow.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/common/MixinSpectralArrow.java @@ -17,12 +17,12 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.common; +package org.auioc.mcmod.harmoniclib.mixin.common; -import org.auioc.mcmod.harmonicench.api.mixin.common.IMixinSpectralArrow; +import net.minecraft.world.entity.projectile.SpectralArrow; +import org.auioc.mcmod.harmoniclib.mixinapi.IMixinSpectralArrow; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import net.minecraft.world.entity.projectile.SpectralArrow; @Mixin(value = SpectralArrow.class) public class MixinSpectralArrow implements IMixinSpectralArrow { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/server/MixinCatRelaxOnOwnerGoal.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/server/MixinCatRelaxOnOwnerGoal.java similarity index 88% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/server/MixinCatRelaxOnOwnerGoal.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/server/MixinCatRelaxOnOwnerGoal.java index e64283e..3c928c5 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/server/MixinCatRelaxOnOwnerGoal.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/server/MixinCatRelaxOnOwnerGoal.java @@ -17,11 +17,11 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.server; +package org.auioc.mcmod.harmoniclib.mixin.server; import net.minecraft.world.entity.animal.Cat; import net.minecraft.world.entity.player.Player; -import org.auioc.mcmod.harmonicench.server.event.HEServerEventFactory; +import org.auioc.mcmod.harmoniclib.event.HLServerEventFactory; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -50,12 +50,12 @@ private void giveMorningGift() { } /** * @author WakelessSloth56 - * @reason CatMorningGiftEvent {@link HEServerEventFactory#onCatMorningGiftConditionCheck} + * @reason CatMorningGiftEvent {@link HLServerEventFactory#onCatMorningGiftConditionCheck} */ @Overwrite // TODO better solution than overwrite? public void stop() { this.cat.setLying(false); - if (HEServerEventFactory.onCatMorningGiftConditionCheck(cat, ownerPlayer)) { + if (HLServerEventFactory.onCatMorningGiftConditionCheck(cat, ownerPlayer)) { this.giveMorningGift(); } diff --git a/src/main/java/org/auioc/mcmod/harmonicench/mixin/server/MixinPiglinAi.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/server/MixinPiglinAi.java similarity index 93% rename from src/main/java/org/auioc/mcmod/harmonicench/mixin/server/MixinPiglinAi.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixin/server/MixinPiglinAi.java index 69be3b6..7a8acab 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/mixin/server/MixinPiglinAi.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixin/server/MixinPiglinAi.java @@ -17,12 +17,12 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.mixin.server; +package org.auioc.mcmod.harmoniclib.mixin.server; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.monster.piglin.PiglinAi; import org.auioc.mcmod.arnicalib.game.entity.MobStance; -import org.auioc.mcmod.harmonicench.utils.EnchantmentPerformer; +import org.auioc.mcmod.harmoniclib.enchantment.EnchantmentPerformer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinAbstractArrow.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinAbstractArrow.java similarity index 94% rename from src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinAbstractArrow.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinAbstractArrow.java index 752a50c..a03fc13 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinAbstractArrow.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinAbstractArrow.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.mixin.common; +package org.auioc.mcmod.harmoniclib.mixinapi; public interface IMixinAbstractArrow { diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinProjectile.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinProjectile.java similarity index 94% rename from src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinProjectile.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinProjectile.java index 11c0ec0..1c6cd18 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinProjectile.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinProjectile.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.mixin.common; +package org.auioc.mcmod.harmoniclib.mixinapi; import org.auioc.mcmod.arnicalib.game.enchantment.IEnchantmentAttachableObject; diff --git a/src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinSpectralArrow.java b/src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinSpectralArrow.java similarity index 94% rename from src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinSpectralArrow.java rename to src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinSpectralArrow.java index d00a033..67fa3fb 100644 --- a/src/main/java/org/auioc/mcmod/harmonicench/api/mixin/common/IMixinSpectralArrow.java +++ b/src/main/java/org/auioc/mcmod/harmoniclib/mixinapi/IMixinSpectralArrow.java @@ -17,7 +17,7 @@ * this program. If not, see . */ -package org.auioc.mcmod.harmonicench.api.mixin.common; +package org.auioc.mcmod.harmoniclib.mixinapi; public interface IMixinSpectralArrow { diff --git a/src/main/resources/META-INF/coremods.json b/src/main/resources/META-INF/coremods.json index 9e3cd69..222226a 100644 --- a/src/main/resources/META-INF/coremods.json +++ b/src/main/resources/META-INF/coremods.json @@ -1,5 +1,5 @@ { - "harmonicench.apply_bonus_count.run": "coremods/apply_bonus_count.run.js", - "harmonicench.living_entity.magic_absorb": "coremods/living_entity.magic_absorb.js", + "harmoniclib.apply_bonus_count.run": "coremods/apply_bonus_count.run.js", + "harmoniclib.living_entity.magic_absorb": "coremods/living_entity.magic_absorb.js", "harmonicench.living_entity.travel": "coremods/living_entity.travel.js" } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 34d0e6f..acf527e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -3,6 +3,37 @@ loaderVersion = "${loader_version_range}" license = "${mod_license}" issueTrackerURL = "https://github.com/auioc/HarmonicEnchantments/issues" +[[mods]] +modId = "${lib_mod_id}" +version = "${mod_version}" +displayName = "${lib_mod_name}" +credits = "${mod_credits}" +authors = "${lib_mod_authors}" +description = '''${lib_mod_description}''' + +[[mixins]] +config="harmoniclib.mixin.json" + +[[dependencies.${lib_mod_id}]] + modId="neoforge" + type="required" + versionRange="${neo_version_range}" + ordering="NONE" + side="BOTH" +[[dependencies.${lib_mod_id}]] + modId="minecraft" + type="required" + versionRange="${minecraft_version_range}" + ordering="NONE" + side="BOTH" +[[dependencies.${lib_mod_id}]] + modId = "arnicalib" + type="required" + versionRange = "${arnicalib_version_range}" + ordering = "NONE" + side = "BOTH" + + [[mods]] modId = "${mod_id}" version = "${mod_version}" @@ -32,3 +63,9 @@ description = '''${mod_description}''' versionRange = "${arnicalib_version_range}" ordering = "NONE" side = "BOTH" +[[dependencies.${mod_id}]] + modId = "${lib_mod_id}" + type="required" + versionRange = "[${mod_version},)" + ordering = "NONE" + side = "BOTH" diff --git a/src/main/resources/coremods/apply_bonus_count.run.js b/src/main/resources/coremods/apply_bonus_count.run.js index 53d92bf..f292858 100644 --- a/src/main/resources/coremods/apply_bonus_count.run.js +++ b/src/main/resources/coremods/apply_bonus_count.run.js @@ -35,7 +35,7 @@ function initializeCoreMod() { toInject.add( new MethodInsnNode( Opcodes.INVOKESTATIC, - 'org/auioc/mcmod/harmonicench/server/event/HEServerEventFactory', + 'org/auioc/mcmod/harmoniclib/event/HLServerEventFactory', 'onApplyLootEnchantmentBonusCount', '(Lnet/minecraft/world/level/storage/loot/LootContext;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/enchantment/Enchantment;I)I', false @@ -78,7 +78,7 @@ function initializeCoreMod() { //_ ... if (itemstack != null) { int i = EnchantmentHelper.getItemEnchantmentLevel(this.enchantment, itemstack); -+ i = HEServerEventFactory.onApplyLootEnchantmentBonusCount(pContext, itemstack, this.enchantment, i) ++ i = HLServerEventFactory.onApplyLootEnchantmentBonusCount(pContext, itemstack, this.enchantment, i) int j = this.formula.calculateNewCount(p_79914_.getRandom(), p_79913_.getCount(), i); p_79913_.setCount(j); } @@ -91,7 +91,7 @@ function initializeCoreMod() { + ALOAD 0 + GETFIELD net/minecraft/world/level/storage/loot/functions/ApplyBonusCount.enchantment : Lnet/minecraft/world/item/enchantment/Enchantment; + ILOAD 4 -+ INVOKESTATIC org/auioc/mcmod/harmonicench/server/event/HEServerEventFactory.onApplyLootEnchantmentBonusCount (Lnet/minecraft/world/level/storage/loot/LootContext;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/enchantment/Enchantment;I)I ++ INVOKESTATIC org/auioc/mcmod/harmoniclib/event/HLServerEventFactory.onApplyLootEnchantmentBonusCount (Lnet/minecraft/world/level/storage/loot/LootContext;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/enchantment/Enchantment;I)I + ISTORE 4 ALOAD 0 GETFIELD net/minecraft/world/level/storage/loot/functions/ApplyBonusCount.formula : Lnet/minecraft/world/level/storage/loot/functions/ApplyBonusCount$Formula; diff --git a/src/main/resources/coremods/living_entity.magic_absorb.js b/src/main/resources/coremods/living_entity.magic_absorb.js index c4c550f..3863574 100644 --- a/src/main/resources/coremods/living_entity.magic_absorb.js +++ b/src/main/resources/coremods/living_entity.magic_absorb.js @@ -35,7 +35,7 @@ function initializeCoreMod() { toInject.add( new MethodInsnNode( Opcodes.INVOKESTATIC, - 'org/auioc/mcmod/harmonicench/utils/EnchantmentPerformer', + 'org/auioc/mcmod/harmoniclib/enchantment/EnchantmentPerformer', 'getDamageProtectionWithItem', '(Ljava/lang/Iterable;Lnet/minecraft/world/damagesource/DamageSource;)I', false @@ -93,7 +93,7 @@ function initializeCoreMod() { + ALOAD 0 + INVOKEVIRTUAL net/minecraft/world/entity/LivingEntity.getArmorSlots ()Ljava/lang/Iterable; + ALOAD 1 -+ INVOKESTATIC org/auioc/mcmod/harmonicench/utils/EnchantmentPerformer.getDamageProtectionWithItem (Ljava/lang/Iterable;Lnet/minecraft/world/damagesource/DamageSource;)I ++ INVOKESTATIC org/auioc/mcmod/harmoniclib/enchantment/EnchantmentPerformer.getDamageProtectionWithItem (Ljava/lang/Iterable;Lnet/minecraft/world/damagesource/DamageSource;)I + IADD + ISTORE 3 //_ ... diff --git a/src/main/resources/coremods/living_entity.travel.js b/src/main/resources/coremods/living_entity.travel.js index 1958c0c..24c3bfd 100644 --- a/src/main/resources/coremods/living_entity.travel.js +++ b/src/main/resources/coremods/living_entity.travel.js @@ -25,7 +25,7 @@ function initializeCoreMod() { toInject.add( new MethodInsnNode( Opcodes.INVOKESTATIC, - 'org/auioc/mcmod/harmonicench/common/mobeffect/impl/WeightlessnessMobEffect', + 'org/auioc/mcmod/harmonicench/effect/impl/WeightlessnessMobEffect', 'adjustFallFlySpeed', '(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3;', false @@ -91,7 +91,7 @@ function initializeCoreMod() { //_ ... + ALOAD 0 + ALOAD 7 -+ INVOKESTATIC org/auioc/mcmod/harmonicench/common/mobeffect/impl/WeightlessnessMobEffect.adjustFallFlySpeed (Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3; ++ INVOKESTATIC org/auioc/mcmod/harmonicench/effect/impl/WeightlessnessMobEffect.adjustFallFlySpeed (Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3; + ASTORE 7 ALOAD 0 ALOAD 7 diff --git a/src/main/resources/harmonicench.mixin.json b/src/main/resources/harmoniclib.mixin.json similarity index 90% rename from src/main/resources/harmonicench.mixin.json rename to src/main/resources/harmoniclib.mixin.json index 1ffa138..ce8e81e 100644 --- a/src/main/resources/harmonicench.mixin.json +++ b/src/main/resources/harmoniclib.mixin.json @@ -1,6 +1,6 @@ { "required": true, - "package": "org.auioc.mcmod.harmonicench.mixin", + "package": "org.auioc.mcmod.harmoniclib.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ "common.MixinAbstractArrow",