diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/HybridAquatic.kt b/src/main/kotlin/dev/hybridlabs/aquatic/HybridAquatic.kt index 0bb40a6fc..65d791a4d 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/HybridAquatic.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/HybridAquatic.kt @@ -4,8 +4,7 @@ import dev.hybridlabs.aquatic.block.HybridAquaticBlocks import dev.hybridlabs.aquatic.block.PlushieBlock import dev.hybridlabs.aquatic.block.SeaMessage import dev.hybridlabs.aquatic.block.entity.HybridAquaticBlockEntityTypes -import dev.hybridlabs.aquatic.effects.HybridAquaticStatusEffects -import dev.hybridlabs.aquatic.effects.HybridAquaticStatusEffects.BLEEDING +import dev.hybridlabs.aquatic.effect.HybridAquaticStatusEffects import dev.hybridlabs.aquatic.enchantment.HybridAquaticEnchantments import dev.hybridlabs.aquatic.entity.HybridAquaticEntityTypes import dev.hybridlabs.aquatic.entity.SpawnRestrictionRegistry @@ -24,7 +23,6 @@ import net.fabricmc.fabric.api.event.registry.DynamicRegistries import net.fabricmc.fabric.api.`object`.builder.v1.trade.TradeOfferHelper import net.minecraft.item.BlockItem import net.minecraft.registry.Registries -import net.minecraft.util.Identifier import net.minecraft.village.TradeOffers.SellItemFactory import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -36,9 +34,6 @@ object HybridAquatic : ModInitializer { override fun onInitialize() { logger.info("Initializing $MOD_ID") - net.minecraft.registry.Registry.register(Registries.STATUS_EFFECT, Identifier("hybrid_aquatic", "bleeding"), BLEEDING) - - HybridAquaticBlocks HybridAquaticBlockEntityTypes diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/data/client/LanguageProvider.kt b/src/main/kotlin/dev/hybridlabs/aquatic/data/client/LanguageProvider.kt index 72421676e..46aac8d7d 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/data/client/LanguageProvider.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/data/client/LanguageProvider.kt @@ -3,7 +3,7 @@ package dev.hybridlabs.aquatic.data.client import dev.hybridlabs.aquatic.block.HybridAquaticBlocks import dev.hybridlabs.aquatic.block.SeaMessage import dev.hybridlabs.aquatic.data.HybridAquaticDataGenerator.filterHybridAquatic -import dev.hybridlabs.aquatic.effects.HybridAquaticStatusEffects +import dev.hybridlabs.aquatic.effect.HybridAquaticStatusEffects import dev.hybridlabs.aquatic.enchantment.HybridAquaticEnchantments import dev.hybridlabs.aquatic.entity.HybridAquaticEntityTypes import dev.hybridlabs.aquatic.item.HybridAquaticItemGroups diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/effects/Bleeding.kt b/src/main/kotlin/dev/hybridlabs/aquatic/effect/Bleeding.kt similarity index 93% rename from src/main/kotlin/dev/hybridlabs/aquatic/effects/Bleeding.kt rename to src/main/kotlin/dev/hybridlabs/aquatic/effect/Bleeding.kt index b7b1afc49..c2d0c5929 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/effects/Bleeding.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/effect/Bleeding.kt @@ -1,4 +1,4 @@ -package dev.hybridlabs.aquatic.effects +package dev.hybridlabs.aquatic.effect import net.minecraft.entity.LivingEntity import net.minecraft.entity.effect.StatusEffect @@ -16,4 +16,4 @@ class Bleeding : StatusEffect(StatusEffectCategory.HARMFUL, 0xee4049) { entity.health = maxOf(entity.health - 2.0f, targetHealth) } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/effect/HybridAquaticStatusEffects.kt b/src/main/kotlin/dev/hybridlabs/aquatic/effect/HybridAquaticStatusEffects.kt new file mode 100644 index 000000000..089406e3b --- /dev/null +++ b/src/main/kotlin/dev/hybridlabs/aquatic/effect/HybridAquaticStatusEffects.kt @@ -0,0 +1,15 @@ +package dev.hybridlabs.aquatic.effect + +import dev.hybridlabs.aquatic.HybridAquatic +import net.minecraft.entity.effect.StatusEffect +import net.minecraft.registry.Registries +import net.minecraft.registry.Registry +import net.minecraft.util.Identifier + +object HybridAquaticStatusEffects { + val BLEEDING = register("bleeding", Bleeding()) + + private fun register(id: String, effect: StatusEffect): StatusEffect { + return Registry.register(Registries.STATUS_EFFECT, Identifier(HybridAquatic.MOD_ID, id), effect) + } +} diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/effects/HybridAquaticStatusEffects.kt b/src/main/kotlin/dev/hybridlabs/aquatic/effects/HybridAquaticStatusEffects.kt deleted file mode 100644 index faa622873..000000000 --- a/src/main/kotlin/dev/hybridlabs/aquatic/effects/HybridAquaticStatusEffects.kt +++ /dev/null @@ -1,14 +0,0 @@ -package dev.hybridlabs.aquatic.effects - -import net.minecraft.entity.effect.StatusEffect -import net.minecraft.registry.Registries -import net.minecraft.registry.Registry -import net.minecraft.util.Identifier - -object HybridAquaticStatusEffects { - val BLEEDING: StatusEffect = Bleeding() - - private fun registerEffects() { - Registry.register(Registries.STATUS_EFFECT, Identifier("hybrid_aquatic", "bleeding"), BLEEDING) - } -} diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/entity/shark/HybridAquaticSharkEntity.kt b/src/main/kotlin/dev/hybridlabs/aquatic/entity/shark/HybridAquaticSharkEntity.kt index b36424f1e..e9b312eb6 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/entity/shark/HybridAquaticSharkEntity.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/entity/shark/HybridAquaticSharkEntity.kt @@ -1,13 +1,25 @@ package dev.hybridlabs.aquatic.entity.shark -import dev.hybridlabs.aquatic.effects.HybridAquaticStatusEffects +import dev.hybridlabs.aquatic.effect.HybridAquaticStatusEffects import dev.hybridlabs.aquatic.item.HybridAquaticItems import dev.hybridlabs.aquatic.tag.HybridAquaticEntityTags import net.minecraft.block.Blocks -import net.minecraft.entity.* +import net.minecraft.entity.EntityData +import net.minecraft.entity.EntityDimensions +import net.minecraft.entity.EntityPose +import net.minecraft.entity.EntityType +import net.minecraft.entity.LivingEntity +import net.minecraft.entity.SpawnReason import net.minecraft.entity.ai.control.AquaticMoveControl import net.minecraft.entity.ai.control.YawAdjustingLookControl -import net.minecraft.entity.ai.goal.* +import net.minecraft.entity.ai.goal.ActiveTargetGoal +import net.minecraft.entity.ai.goal.ChaseBoatGoal +import net.minecraft.entity.ai.goal.LookAroundGoal +import net.minecraft.entity.ai.goal.LookAtEntityGoal +import net.minecraft.entity.ai.goal.MeleeAttackGoal +import net.minecraft.entity.ai.goal.RevengeGoal +import net.minecraft.entity.ai.goal.SwimAroundGoal +import net.minecraft.entity.ai.goal.UniversalAngerGoal import net.minecraft.entity.ai.pathing.PathNodeType import net.minecraft.entity.ai.pathing.SwimNavigation import net.minecraft.entity.damage.DamageSource @@ -15,7 +27,6 @@ import net.minecraft.entity.data.DataTracker import net.minecraft.entity.data.TrackedData import net.minecraft.entity.data.TrackedDataHandlerRegistry import net.minecraft.entity.effect.StatusEffectInstance -import net.minecraft.entity.effect.StatusEffects import net.minecraft.entity.mob.Angerable import net.minecraft.entity.mob.WaterCreatureEntity import net.minecraft.entity.player.PlayerEntity @@ -37,11 +48,14 @@ import net.minecraft.world.WorldAccess import software.bernie.geckolib.animatable.GeoEntity import software.bernie.geckolib.core.animatable.GeoAnimatable import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache -import software.bernie.geckolib.core.animation.* +import software.bernie.geckolib.core.animation.AnimatableManager +import software.bernie.geckolib.core.animation.Animation +import software.bernie.geckolib.core.animation.AnimationController import software.bernie.geckolib.core.animation.AnimationState +import software.bernie.geckolib.core.animation.RawAnimation import software.bernie.geckolib.core.`object`.PlayState import software.bernie.geckolib.util.GeckoLibUtil -import java.util.* +import java.util.UUID @Suppress("LeakingThis")