Skip to content

Commit

Permalink
Minor changes to the widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crystal-Spider committed Jan 17, 2025
1 parent 9801976 commit d2ced26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ private CommonModLoader() {}
/**
* Initialize common operations across loaders.
*/
public static void init() {


}
public static void init() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d2ced26

Please sign in to comment.