Skip to content

Commit

Permalink
Only distance check when there is a player. #60
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Sep 23, 2022
1 parent 7bbe8b8 commit 608e86a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class CustomHeadLayerMixin<T extends LivingEntity, M extends EntityModel<
public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, T livingEntity, float f,
float g, float h, float j, float k, float l, CallbackInfo info) {
if(!SkinLayersModBase.config.enableSkulls)return;
if(livingEntity.distanceToSqr(Minecraft.getInstance().player) > SkinLayersModBase.config.renderDistanceLOD*SkinLayersModBase.config.renderDistanceLOD) {
if(Minecraft.getInstance().player != null && livingEntity.distanceToSqr(Minecraft.getInstance().player) > SkinLayersModBase.config.renderDistanceLOD*SkinLayersModBase.config.renderDistanceLOD) {
return; // too far away
}
ItemStack itemStack = livingEntity.getItemBySlot(EquipmentSlot.HEAD);
Expand Down

0 comments on commit 608e86a

Please sign in to comment.