use of net.minecraft.server.v1_14_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);
}
}
Aggregations