diff --git a/gradle.properties b/gradle.properties index d7f09386..2deac362 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,6 +4,6 @@ mc_version=1.19.2 forge_version=43.2.0 jei_version=11.4.0.285 curio_version=5.1.1.0 -mod_version=0.5.9.3.2 +mod_version=0.5.9.4 ars_version=3.22.2.674 mod_id=ars_elemental \ No newline at end of file diff --git a/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonDolphin.java b/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonDolphin.java index 8212dd00..f9f0f903 100644 --- a/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonDolphin.java +++ b/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonDolphin.java @@ -22,6 +22,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.Optional; @@ -47,7 +48,7 @@ public SummonDolphin(SummonHorse oldHorse, Player summoner) { } @Override - public EntityType getType() { + public @NotNull EntityType getType() { return ModEntities.DOLPHIN_SUMMON.get(); } @@ -62,7 +63,7 @@ protected void registerGoals() { } @Override - public void positionRider(Entity passenger) { + public void positionRider(@NotNull Entity passenger) { super.positionRider(passenger); if (passenger instanceof Mob mob && this.getControllingPassenger() == passenger) { this.yBodyRot = mob.yBodyRot; @@ -90,13 +91,13 @@ public LivingEntity getControllingPassenger() { } @Override - protected boolean canRide(Entity pEntity) { + protected boolean canRide(@NotNull Entity pEntity) { return pEntity instanceof Player; } @Override - public InteractionResult mobInteract(Player player, InteractionHand hand) { + public @NotNull InteractionResult mobInteract(Player player, @NotNull InteractionHand hand) { if (player.level.isClientSide()) return InteractionResult.PASS; @@ -109,7 +110,7 @@ public InteractionResult mobInteract(Player player, InteractionHand hand) { } @Override - public void travel(Vec3 pTravelVector) { + public void travel(@NotNull Vec3 pTravelVector) { if (this.isAlive()) { LivingEntity livingentity = this.getControllingPassenger(); if (this.isVehicle() && livingentity != null) { @@ -192,13 +193,13 @@ public void tick() { } @Override - public void die(DamageSource cause) { + public void die(@NotNull DamageSource cause) { super.die(cause); onSummonDeath(level, cause, false); } @Override - public void readAdditionalSaveData(CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); this.ticksLeft = compound.getInt("left"); UUID uuid = null; @@ -211,7 +212,7 @@ public void readAdditionalSaveData(CompoundTag compound) { } @Override - public void addAdditionalSaveData(CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putInt("left", ticksLeft); writeOwner(compound); @@ -230,7 +231,7 @@ public void setTicksLeft(int ticks) { @Nullable @Override - public UUID getOwnerID() { + public UUID getOwnerUUID() { return this.getEntityData().get(OWNER_UUID).isEmpty() ? this.getUUID() : this.getEntityData().get(OWNER_UUID).get(); } diff --git a/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonStrider.java b/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonStrider.java index 96549bc5..3338a45a 100644 --- a/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonStrider.java +++ b/src/main/java/alexthw/ars_elemental/common/entity/summon/SummonStrider.java @@ -22,6 +22,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.Optional; @@ -37,7 +38,7 @@ public SummonStrider(Level pLevel) { } @Override - public EntityType getType() { + public @NotNull EntityType getType() { return ModEntities.STRIDER_SUMMON.get(); } @@ -62,12 +63,12 @@ public LivingEntity getControllingPassenger() { } @Override - protected boolean canRide(Entity pEntity) { + protected boolean canRide(@NotNull Entity pEntity) { return pEntity instanceof Player; } @Override - public void travel(Vec3 pTravelVector) { + public void travel(@NotNull Vec3 pTravelVector) { if (this.isAlive()) { LivingEntity livingentity = this.getControllingPassenger(); if (this.isVehicle() && livingentity != null) { @@ -99,7 +100,7 @@ public void travel(Vec3 pTravelVector) { } @Override - public InteractionResult mobInteract(Player player, InteractionHand hand) { + public @NotNull InteractionResult mobInteract(Player player, @NotNull InteractionHand hand) { if (!player.level.isClientSide() && player.getMainHandItem().isEmpty() && !player.isShiftKeyDown()) { player.startRiding(this); return InteractionResult.SUCCESS; @@ -138,13 +139,13 @@ public void tick() { } @Override - public void die(DamageSource cause) { + public void die(@NotNull DamageSource cause) { super.die(cause); onSummonDeath(level, cause, false); } @Override - public void readAdditionalSaveData(CompoundTag compound) { + public void readAdditionalSaveData(@NotNull CompoundTag compound) { super.readAdditionalSaveData(compound); this.ticksLeft = compound.getInt("left"); UUID uuid = null; @@ -157,7 +158,7 @@ public void readAdditionalSaveData(CompoundTag compound) { } @Override - public void addAdditionalSaveData(CompoundTag compound) { + public void addAdditionalSaveData(@NotNull CompoundTag compound) { super.addAdditionalSaveData(compound); compound.putInt("left", ticksLeft); writeOwner(compound); @@ -176,7 +177,7 @@ public void setTicksLeft(int ticks) { @Nullable @Override - public UUID getOwnerID() { + public UUID getOwnerUUID() { return this.getEntityData().get(OWNER_UUID).isEmpty() ? this.getUUID() : this.getEntityData().get(OWNER_UUID).get(); } @@ -186,11 +187,11 @@ public void setOwnerID(UUID uuid) { } //override - public Strider getBreedOffspring(ServerLevel pLevel, AgeableMob pOtherParent) { + public Strider getBreedOffspring(@NotNull ServerLevel pLevel, @NotNull AgeableMob pOtherParent) { return null; } - public boolean isFood(ItemStack pStack) { + public boolean isFood(@NotNull ItemStack pStack) { return false; } @@ -198,7 +199,7 @@ protected void dropEquipment() { } @Override - public boolean canMate(Animal pOtherAnimal) { + public boolean canMate(@NotNull Animal pOtherAnimal) { return false; } diff --git a/src/main/java/alexthw/ars_elemental/common/glyphs/MethodHomingProjectile.java b/src/main/java/alexthw/ars_elemental/common/glyphs/MethodHomingProjectile.java index 699eb34e..5faa6c31 100644 --- a/src/main/java/alexthw/ars_elemental/common/glyphs/MethodHomingProjectile.java +++ b/src/main/java/alexthw/ars_elemental/common/glyphs/MethodHomingProjectile.java @@ -64,11 +64,11 @@ public CastResolveType onCast(ItemStack stack, LivingEntity shooter, Level world List> ignore = basicIgnores(shooter, spellStats.hasBuff(AugmentSensitive.INSTANCE), resolver.spell); if (shooter instanceof Player) { - ignore.add(entity -> entity instanceof ISummon summon && shooter.getUUID().equals(summon.getOwnerID())); + ignore.add(entity -> entity instanceof ISummon summon && shooter.getUUID().equals(summon.getOwnerUUID())); ignore.add(entity -> entity instanceof OwnableEntity pet && shooter.equals(pet.getOwner())); - } else if (shooter instanceof ISummon summon && summon.getOwnerID() != null) { - ignore.add(entity -> entity instanceof ISummon summon2 && summon.getOwnerID().equals(summon2.getOwnerID())); - ignore.add(entity -> entity instanceof OwnableEntity pet && summon.getOwnerID().equals(pet.getOwnerUUID())); + } else if (shooter instanceof ISummon summon && summon.getOwnerUUID() != null) { + ignore.add(entity -> entity instanceof ISummon summon2 && summon.getOwnerUUID().equals(summon2.getOwnerUUID())); + ignore.add(entity -> entity instanceof OwnableEntity pet && summon.getOwnerUUID().equals(pet.getOwnerUUID())); } summonProjectiles(world, shooter, spellStats, resolver, ignore); diff --git a/src/main/java/alexthw/ars_elemental/common/items/foci/NecroticFocus.java b/src/main/java/alexthw/ars_elemental/common/items/foci/NecroticFocus.java index 56aab0c0..4791b9e1 100644 --- a/src/main/java/alexthw/ars_elemental/common/items/foci/NecroticFocus.java +++ b/src/main/java/alexthw/ars_elemental/common/items/foci/NecroticFocus.java @@ -93,8 +93,8 @@ public SpellStats.Builder applyItemModifiers(ItemStack stack, SpellStats.Builder @SubscribeEvent public static void lifeSteal(LivingDeathEvent event){ // if the source of the damage is a summoned undead entity, heal the player who summoned it. - if (event.getSource().getEntity() instanceof IUndeadSummon risen && risen.getOwnerID() != null && event.getEntity().getLevel() instanceof ServerLevel level) { - Player player = event.getEntity().level.getPlayerByUUID(risen.getOwnerID()); + if (event.getSource().getEntity() instanceof IUndeadSummon risen && risen.getOwnerUUID() != null && event.getEntity().getLevel() instanceof ServerLevel level) { + Player player = event.getEntity().level.getPlayerByUUID(risen.getOwnerUUID()); if (player != null) { player.heal(2.0F); level.addFreshEntity(new EntityFollowProjectile(level, risen.getLivingEntity().blockPosition(), player.blockPosition(), ParticleUtil.soulColor.toWrapper())); @@ -106,7 +106,7 @@ public static void lifeSteal(LivingDeathEvent event){ public static void castSpell(SpellCastEvent event) { // if the player has a necrotic focus, and the spell is a homing projectile, make the summoned undead mobs look at the player's last target and recast the spell. if (event.getWorld() instanceof ServerLevel world && event.getEntity() instanceof Player player && hasFocus(world, player) && event.spell.getCastMethod() == MethodHomingProjectile.INSTANCE) { - for (Mob i : world.getEntitiesOfClass(Mob.class, new AABB(event.getEntity().blockPosition()).inflate(30.0D), (l) -> l instanceof IUndeadSummon summon && player.getUUID().equals(summon.getOwnerID()))) { + for (Mob i : world.getEntitiesOfClass(Mob.class, new AABB(event.getEntity().blockPosition()).inflate(30.0D), (l) -> l instanceof IUndeadSummon summon && player.getUUID().equals(summon.getOwnerUUID()))) { LivingEntity target = i.getTarget(); if (target == null) target = player.getLastHurtMob(); if (target != null && target.isAlive()) {