glBlendFunc(GL_DST_COLOR, GL_ZERO);
Vector3f cameraPosition = CoreRegistry.get(WorldRenderer.class).getActiveCamera().getPosition();
for (EntityRef entity : entityManager.getEntitiesWith(HealthComponent.class, BlockComponent.class)) {
HealthComponent health = entity.getComponent(HealthComponent.class);
if (health.currentHealth == health.maxHealth) {
continue;
}
BlockComponent blockComp = entity.getComponent(BlockComponent.class);
renderHealth(blockComp.getPosition(), health, cameraPosition);
}
for (EntityRef entity : entityManager.getEntitiesWith(BlockRegionComponent.class, HealthComponent.class)) {
HealthComponent health = entity.getComponent(HealthComponent.class);
if (health.currentHealth == health.maxHealth) {
continue;
}
BlockRegionComponent blockRegion = entity.getComponent(BlockRegionComponent.class);
for (Vector3i blockPos : blockRegion.region) {