Fix ignoring maxUpStep method overrides on entities (#9583)

This commit is contained in:
Sara Freimer authored and GitHub committed 2023-06-27 13:55:52 +02:00
1 parent 9450dfd67c
commit a43be39137
4 files changed
+20 -11

No files matched your search

@@ -17,14 +17,7 @@
private final EntityType<?> f_19847_;
private int f_19848_ = f_19843_.incrementAndGet();
public boolean f_19850_;
@@ -181,14 +_,17 @@
public double f_19790_;
public double f_19791_;
public double f_19792_;
+ @Deprecated // Forge - see IForgeEntity#getStepHeight
public float f_19793_;
public boolean f_19794_;
protected final RandomSource f_19796_ = RandomSource.m_216327_();
@@ -187,8 +_,10 @@
public int f_19797_;
private int f_19831_ = -this.m_6101_();
protected boolean f_19798_;
@@ -524,6 +517,14 @@
}
@@ -3264,6 +_,7 @@
return false;
}
+ @Deprecated /** Forge: Use {@link net.minecraftforge.common.extensions.IForgeEntity#getStepHeight()} */
public float m_274421_() {
return this.f_19793_;
}
@@ -3319,6 +_,103 @@
public boolean m_142265_(Level p_146843_, BlockPos p_146844_) {
return true;
@@ -9,6 +9,15 @@
}
double d0 = this.m_142213_(new BlockPos(p_77641_.f_77271_, p_77641_.f_77272_, p_77641_.f_77273_));
@@ -306,7 +_,7 @@
}
private double m_255203_() {
- return Math.max(1.125D, (double)this.f_77313_.m_274421_());
+ return Math.max(1.125D, (double)this.f_77313_.getStepHeight());
}
private Node m_230619_(int p_230620_, int p_230621_, int p_230622_, BlockPathTypes p_230623_, float p_230624_) {
@@ -453,6 +_,11 @@
if (l != 0 || j1 != 0) {
p_77609_.m_122178_(i + l, j + i1, k + j1);
@@ -203,13 +203,13 @@ public interface IForgeEntity extends ICapabilitySerializable<CompoundTag>
/**
* @return Return the height in blocks the Entity can step up without needing to jump
* This is the sum of vanilla's {@link Entity#maxUpStep} field and the current value
* This is the sum of vanilla's {@link Entity#maxUpStep()} method and the current value
* of the {@link net.minecraftforge.common.ForgeMod#STEP_HEIGHT_ADDITION} attribute
* (if this Entity is a {@link LivingEntity} and has the attribute), clamped at 0.
*/
default float getStepHeight()
{
float vanillaStep = self().maxUpStep;
float vanillaStep = self().maxUpStep();
if (self() instanceof LivingEntity living)
{
AttributeInstance stepHeightAttribute = living.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get());
@@ -219,7 +219,6 @@ public net.minecraft.util.thread.BlockableEventLoop m_18689_(Ljava/lang/Runnable
#group public net.minecraft.world.damagesource.DamageSource *() #All methods public, most are already
public net.minecraft.world.damagesource.DamageSource <init>(Lnet/minecraft/core/Holder;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/Vec3;)V # constructor
#endgroup
public net.minecraft.world.entity.Entity f_19793_ # maxUpStep
protected net.minecraft.world.entity.Entity f_19843_ # ENTITY_COUNTER
public net.minecraft.world.entity.Entity m_20078_()Ljava/lang/String; # getEncodeId
public net.minecraft.world.entity.ExperienceOrb f_20770_ # value