EntityHeights.java 601 Bytes
Newer Older
1 2 3
package com.owlmaddie.utils;

import net.minecraft.entity.boss.dragon.EnderDragonEntity;
4
import net.minecraft.entity.Entity;
5 6 7 8 9 10

/**
 * The {@code EntityHeightMap} class returns an adjusted entity height (which fixes certain MobEntity's with
 * unusually tall heights)
 */
public class EntityHeights {
11
    public static float getAdjustedEntityHeight(Entity entity) {
12 13 14 15 16 17 18 19
        // Get entity height (adjust for specific classes)
        float entityHeight = entity.getHeight();
        if (entity instanceof EnderDragonEntity) {
            entityHeight = 3F;
        }
        return entityHeight;
    }
}