Skip to content

Commit

Permalink
gradle up
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexthw46 committed Jan 21, 2024
1 parent c02f833 commit bf38ce1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -47,7 +48,7 @@ public SummonDolphin(SummonHorse oldHorse, Player summoner) {
}

@Override
public EntityType<?> getType() {
public @NotNull EntityType<?> getType() {
return ModEntities.DOLPHIN_SUMMON.get();
}

Expand All @@ -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;
Expand Down Expand Up @@ -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;

Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,7 +38,7 @@ public SummonStrider(Level pLevel) {
}

@Override
public EntityType<?> getType() {
public @NotNull EntityType<?> getType() {
return ModEntities.STRIDER_SUMMON.get();
}

Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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();
}

Expand All @@ -186,19 +187,19 @@ 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;
}

protected void dropEquipment() {
}

@Override
public boolean canMate(Animal pOtherAnimal) {
public boolean canMate(@NotNull Animal pOtherAnimal) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public CastResolveType onCast(ItemStack stack, LivingEntity shooter, Level world
List<Predicate<LivingEntity>> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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()) {
Expand Down

0 comments on commit bf38ce1

Please sign in to comment.