Skip to content

Commit

Permalink
remove
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Nov 24, 2024
1 parent 9638933 commit 59c4a31
Showing 1 changed file with 0 additions and 187 deletions.
187 changes: 0 additions & 187 deletions src/main/java/com/minecolonies/core/entity/citizen/EntityCitizen.java
Original file line number Diff line number Diff line change
Expand Up @@ -1546,193 +1546,6 @@ private void performMoveAway(@Nullable final Entity attacker)
}
}

@Override
public void travel(Vec3 p_21280_)
{
if (this.isControlledByLocalInstance())
{
double d0 = 0.08D;
AttributeInstance gravity = this.getAttribute(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get());
boolean flag = this.getDeltaMovement().y <= 0.0D;
if (flag && this.hasEffect(MobEffects.SLOW_FALLING))
{
if (!gravity.hasModifier(SLOW_FALLING))
{
gravity.addTransientModifier(SLOW_FALLING);
}
}
else if (gravity.hasModifier(SLOW_FALLING))
{
gravity.removeModifier(SLOW_FALLING);
}
d0 = gravity.getValue();

FluidState fluidstate = this.level().getFluidState(this.blockPosition());
if ((this.isInWater() || (this.isInFluidType(fluidstate) && fluidstate.getFluidType() != net.minecraftforge.common.ForgeMod.LAVA_TYPE.get()))
&& this.isAffectedByFluids() && !this.canStandOnFluid(fluidstate))
{
if (this.isInWater() || (this.isInFluidType(fluidstate) && !this.moveInFluid(fluidstate, p_21280_, d0)))
{
double d9 = this.getY();
float f4 = this.isSprinting() ? 0.9F : this.getWaterSlowDown();
float f5 = 0.02F;
float f6 = (float) EnchantmentHelper.getDepthStrider(this);
if (f6 > 3.0F)
{
f6 = 3.0F;
}

if (!this.onGround())
{
f6 *= 0.5F;
}

if (f6 > 0.0F)
{
f4 += (0.54600006F - f4) * f6 / 3.0F;
f5 += (this.getSpeed() - f5) * f6 / 3.0F;
}

if (this.hasEffect(MobEffects.DOLPHINS_GRACE))
{
f4 = 0.96F;
}

f5 *= (float) this.getAttribute(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).getValue();
this.moveRelative(f5, p_21280_);
this.move(MoverType.SELF, this.getDeltaMovement());
Vec3 vec36 = this.getDeltaMovement();
if (this.horizontalCollision && this.onClimbable())
{
// We handle climbing ourselves
return;
}

this.setDeltaMovement(vec36.multiply((double) f4, (double) 0.8F, (double) f4));
Vec3 vec32 = this.getFluidFallingAdjustedMovement(d0, flag, this.getDeltaMovement());
this.setDeltaMovement(vec32);
if (this.horizontalCollision && this.isFree(vec32.x, vec32.y + (double) 0.6F - this.getY() + d9, vec32.z))
{
this.setDeltaMovement(vec32.x, (double) 0.3F, vec32.z);
}
}
}
else if (this.isInLava() && this.isAffectedByFluids() && !this.canStandOnFluid(fluidstate))
{
double d8 = this.getY();
this.moveRelative(0.02F, p_21280_);
this.move(MoverType.SELF, this.getDeltaMovement());
if (this.getFluidHeight(FluidTags.LAVA) <= this.getFluidJumpThreshold())
{
this.setDeltaMovement(this.getDeltaMovement().multiply(0.5D, (double) 0.8F, 0.5D));
Vec3 vec33 = this.getFluidFallingAdjustedMovement(d0, flag, this.getDeltaMovement());
this.setDeltaMovement(vec33);
}
else
{
this.setDeltaMovement(this.getDeltaMovement().scale(0.5D));
}

if (!this.isNoGravity())
{
this.setDeltaMovement(this.getDeltaMovement().add(0.0D, -d0 / 4.0D, 0.0D));
}

Vec3 vec34 = this.getDeltaMovement();
if (this.horizontalCollision && this.isFree(vec34.x, vec34.y + (double) 0.6F - this.getY() + d8, vec34.z))
{
this.setDeltaMovement(vec34.x, (double) 0.3F, vec34.z);
}
}
else if (this.isFallFlying())
{
this.checkSlowFallDistance();
Vec3 vec3 = this.getDeltaMovement();
Vec3 vec31 = this.getLookAngle();
float f = this.getXRot() * ((float) Math.PI / 180F);
double d1 = Math.sqrt(vec31.x * vec31.x + vec31.z * vec31.z);
double d3 = vec3.horizontalDistance();
double d4 = vec31.length();
double d5 = Math.cos((double) f);
d5 = d5 * d5 * Math.min(1.0D, d4 / 0.4D);
vec3 = this.getDeltaMovement().add(0.0D, d0 * (-1.0D + d5 * 0.75D), 0.0D);
if (vec3.y < 0.0D && d1 > 0.0D)
{
double d6 = vec3.y * -0.1D * d5;
vec3 = vec3.add(vec31.x * d6 / d1, d6, vec31.z * d6 / d1);
}

if (f < 0.0F && d1 > 0.0D)
{
double d10 = d3 * (double) (-Mth.sin(f)) * 0.04D;
vec3 = vec3.add(-vec31.x * d10 / d1, d10 * 3.2D, -vec31.z * d10 / d1);
}

if (d1 > 0.0D)
{
vec3 = vec3.add((vec31.x / d1 * d3 - vec3.x) * 0.1D, 0.0D, (vec31.z / d1 * d3 - vec3.z) * 0.1D);
}

this.setDeltaMovement(vec3.multiply((double) 0.99F, (double) 0.98F, (double) 0.99F));
this.move(MoverType.SELF, this.getDeltaMovement());
if (this.horizontalCollision && !this.level().isClientSide)
{
double d11 = this.getDeltaMovement().horizontalDistance();
double d7 = d3 - d11;
float f1 = (float) (d7 * 10.0D - 3.0D);
if (f1 > 0.0F)
{
this.playSound(f1 > 4 ? this.getFallSounds().big() : this.getFallSounds().small(), 1.0F, 1.0F);
this.hurt(this.damageSources().flyIntoWall(), f1);
}
}

if (this.onGround() && !this.level().isClientSide)
{
this.setSharedFlag(7, false);
}
}
else
{
BlockPos blockpos = this.getBlockPosBelowThatAffectsMyMovement();
float f2 = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getFriction(level(), this.getBlockPosBelowThatAffectsMyMovement(), this);
float f3 = this.onGround() ? f2 * 0.91F : 0.91F;
Vec3 vec35 = this.handleRelativeFrictionAndCalculateMovement(p_21280_, f2);
double d2 = vec35.y;
if (this.hasEffect(MobEffects.LEVITATION))
{
d2 += (0.05D * (double) (this.getEffect(MobEffects.LEVITATION).getAmplifier() + 1) - vec35.y) * 0.2D;
}
else if (this.level().isClientSide && !this.level().hasChunkAt(blockpos))
{
if (this.getY() > (double) this.level().getMinBuildHeight())
{
d2 = -0.1D;
}
else
{
d2 = 0.0D;
}
}
else if (!this.isNoGravity())
{
d2 -= d0;
}

if (this.shouldDiscardFriction())
{
this.setDeltaMovement(vec35.x, d2, vec35.z);
}
else
{
this.setDeltaMovement(vec35.x * (double) f3, d2 * (double) 0.98F, vec35.z * (double) f3);
}
}
}

this.calculateEntityAnimation(this instanceof FlyingAnimal);
}

@Override
public void callForHelp(final Entity attacker, final int guardHelpRange)
{
Expand Down

0 comments on commit 59c4a31

Please sign in to comment.