Search in sources :

Example 1 with DataWatcherObject

use of net.minecraft.server.v1_15_R1.DataWatcherObject in project Citizens2 by CitizensDev.

the class NMSImpl method checkAndUpdateHeight.

public static void checkAndUpdateHeight(EntityLiving living, DataWatcherObject<?> datawatcherobject) {
    EntitySize size;
    try {
        size = (EntitySize) SIZE_FIELD_GETTER.invoke(living);
    } catch (Throwable e) {
        e.printStackTrace();
        living.a(datawatcherobject);
        return;
    }
    float oldw = size.width;
    float oldl = size.height;
    living.a(datawatcherobject);
    if (oldw != size.width || size.height != oldl) {
        living.setPosition(living.locX() - 0.01, living.locY(), living.locZ() - 0.01);
        living.setPosition(living.locX() + 0.01, living.locY(), living.locZ() + 0.01);
    }
}
Also used : EntitySize(net.minecraft.server.v1_15_R1.EntitySize)

Aggregations

EntitySize (net.minecraft.server.v1_15_R1.EntitySize)1