Skip to content

Commit

Permalink
Tiny cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jan 20, 2024
1 parent 97d7022 commit 02faa9c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
build/
out/
classes/
logs/

# eclipse

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void loadConfig() {
new String(Files.readAllBytes(settingsFile.toPath()), StandardCharsets.UTF_8),
FirstPersonSettings.class);
} catch (Exception ex) {
LOGGER.warn("Unable to load the config, creating a new one.", ex);
LOGGER.warn("Unable to load the config, creating a new one.", ex);
}
}
if (config == null) {
Expand All @@ -52,7 +52,7 @@ public void writeSettings() {
try {
Files.write(settingsFile.toPath(), json.getBytes(StandardCharsets.UTF_8));
} catch (IOException e) {
LOGGER.warn("Error while saving the config!", e);
LOGGER.warn("Error while saving the config!", e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public void renderHead(LivingEntity livingEntity, float f, float g, PoseStack ma
return;
}
((ModelPartBase) (Object) ((HeadedModel) model).getHead()).setHidden();
if (model instanceof VillagerHeadModel) {
((VillagerHeadModel) model).hatVisible(false);
if (model instanceof VillagerHeadModel villaterHead) {
villaterHead.hatVisible(false);
}
}
}
Expand All @@ -50,8 +50,8 @@ public void renderReturn(LivingEntity livingEntity, float f, float g, PoseStack
EntityModel<LivingEntity> model = getModel();
if (model instanceof HeadedModel) {
((ModelPartBase) (Object) ((HeadedModel) model).getHead()).showAgain();
if (model instanceof VillagerHeadModel) {
((VillagerHeadModel) model).hatVisible(true);
if (model instanceof VillagerHeadModel villaterHead) {
villaterHead.hatVisible(true);
}
}
}
Expand Down

0 comments on commit 02faa9c

Please sign in to comment.