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

@@ -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());