From d2ced26cfe1fa9b6521e0c5e75936a72f0cdafa4 Mon Sep 17 00:00:00 2001 From: Crystal Spider Date: Fri, 17 Jan 2025 20:51:24 +0100 Subject: [PATCH] Minor changes to the widget. --- .../fancy_entity_renderer/CommonModLoader.java | 5 +---- .../entity/player/FancyPlayerWidget.java | 15 +++++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/it/crystalnest/fancy_entity_renderer/CommonModLoader.java b/common/src/main/java/it/crystalnest/fancy_entity_renderer/CommonModLoader.java index 590947a..4a9d90f 100644 --- a/common/src/main/java/it/crystalnest/fancy_entity_renderer/CommonModLoader.java +++ b/common/src/main/java/it/crystalnest/fancy_entity_renderer/CommonModLoader.java @@ -12,8 +12,5 @@ private CommonModLoader() {} /** * Initialize common operations across loaders. */ - public static void init() { - - - } + public static void init() {} } \ No newline at end of file diff --git a/common/src/main/java/it/crystalnest/fancy_entity_renderer/entity/player/FancyPlayerWidget.java b/common/src/main/java/it/crystalnest/fancy_entity_renderer/entity/player/FancyPlayerWidget.java index 22ae48c..a2b16a7 100644 --- a/common/src/main/java/it/crystalnest/fancy_entity_renderer/entity/player/FancyPlayerWidget.java +++ b/common/src/main/java/it/crystalnest/fancy_entity_renderer/entity/player/FancyPlayerWidget.java @@ -71,14 +71,17 @@ protected void updateWidgetNarration(@NotNull NarrationElementOutput output) { // TODO: Maybe add narration for when the player name is visible (what about when the name is visible and the player is crouching?). } - record Model(PlayerModel wideModel, PlayerModel slimModel) { + record Model(PlayerModel wideModel, PlayerModel slimModel, PlayerModel babyWideModel, PlayerModel babySlimModel) { + static LayerDefinition WIDE = LayerDefinition.create(PlayerModel.createMesh(CubeDeformation.NONE, false), 64, 64); + static LayerDefinition SLIM = LayerDefinition.create(PlayerModel.createMesh(CubeDeformation.NONE, true), 64, 64); + public static FancyPlayerWidget.Model bake() { // Qui al posto di prendere l'EntityModelSet ecc, creo direttamente le cose. - PlayerModel wideModel = new PlayerModel(LayerDefinition.create(PlayerModel.createMesh(CubeDeformation.NONE, false), 64, 64).bakeRoot(), false); - PlayerModel slimModel = new PlayerModel(LayerDefinition.create(PlayerModel.createMesh(CubeDeformation.NONE, true), 64, 64).bakeRoot(), true); - PlayerModel babyWideModel = new PlayerModel(LayerDefinition.create(PlayerModel.createMesh(CubeDeformation.NONE, false), 64, 64).apply(PlayerModel.BABY_TRANSFORMER).bakeRoot(), false); - PlayerModel babySlimModel = new PlayerModel(LayerDefinition.create(PlayerModel.createMesh(CubeDeformation.NONE, true), 64, 64).apply(PlayerModel.BABY_TRANSFORMER).bakeRoot(), true); - return new FancyPlayerWidget.Model(wideModel, slimModel); + PlayerModel wideModel = new PlayerModel(WIDE.bakeRoot(), false); + PlayerModel slimModel = new PlayerModel(SLIM.bakeRoot(), true); + PlayerModel babyWideModel = new PlayerModel(WIDE.apply(PlayerModel.BABY_TRANSFORMER).bakeRoot(), false); + PlayerModel babySlimModel = new PlayerModel(SLIM.apply(PlayerModel.BABY_TRANSFORMER).bakeRoot(), true); + return new FancyPlayerWidget.Model(wideModel, slimModel, babyWideModel, babySlimModel); } public void render(GuiGraphics gfx, PlayerSkin skin) {