use of mathax.client.mixin.ProjectileEntityAccessor in project Client by MatHax.
the class EntityOwner method onRender2D.
@EventHandler
private void onRender2D(Render2DEvent event) {
for (Entity entity : mc.world.getEntities()) {
UUID ownerUuid;
if (entity instanceof TameableEntity)
ownerUuid = ((TameableEntity) entity).getOwnerUuid();
else if (entity instanceof HorseBaseEntity)
ownerUuid = ((HorseBaseEntity) entity).getOwnerUuid();
else if (entity instanceof ProjectileEntity && projectiles.get())
ownerUuid = ((ProjectileEntityAccessor) entity).getOwnerUuid();
else
continue;
if (ownerUuid != null) {
pos.set(entity, event.tickDelta);
pos.add(0, entity.getEyeHeight(entity.getPose()) + 0.75, 0);
if (NametagUtils.to2D(pos, scale.get())) {
renderNametag(getOwnerName(ownerUuid));
}
}
}
}
Aggregations