Skip to content

Commit

Permalink
Add creaking heart block.
Browse files Browse the repository at this point in the history
  • Loading branch information
leMaik committed Oct 27, 2024
1 parent a6d65f3 commit 2d14168
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,9 @@ private static void addBlocks(Texture texture, String... names) {
tag.get("Properties").get("east").stringValue("none"),
tag.get("Properties").get("south").stringValue("none"),
tag.get("Properties").get("west").stringValue("none")));
addBlock("creaking_heart", (name, tag) -> new CreakingHeart(name,
tag.get("Properties").get("axis").stringValue("y"),
tag.get("Properties").get("creaking").stringValue("active")));
}

@Override
Expand Down
24 changes: 24 additions & 0 deletions chunky/src/java/se/llbit/chunky/block/minecraft/CreakingHeart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package se.llbit.chunky.block.minecraft;

import se.llbit.chunky.block.AbstractModelBlock;
import se.llbit.chunky.model.minecraft.LogModel;
import se.llbit.chunky.resources.Texture;

public class CreakingHeart extends AbstractModelBlock {
private final String description;

public CreakingHeart(String name, String axis, String creaking) {
super(name, Texture.creakingHeartTop);
this.model = new LogModel(
axis,
creaking.equals("disabled") ? Texture.creakingHeart : Texture.creakingHeartActive,
creaking.equals("disabled") ? Texture.creakingHeartTop : Texture.creakingHeartTopActive
);
this.description = String.format("axis=%s, creaking=%s", axis, creaking);
}

@Override
public String description() {
return description;
}
}
8 changes: 8 additions & 0 deletions chunky/src/java/se/llbit/chunky/resources/Texture.java
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,14 @@ public class Texture {
public static final Texture paleMossCarpetSideSmall = new Texture();
@TexturePath("assets/minecraft/textures/block/pale_moss_carpet_side_tall")
public static final Texture paleMossCarpetSideTall = new Texture();
@TexturePath("assets/minecraft/textures/block/creaking_heart")
public static final Texture creakingHeart = new Texture();
@TexturePath("assets/minecraft/textures/block/creaking_heart_top")
public static final Texture creakingHeartTop = new Texture();
@TexturePath("assets/minecraft/textures/block/creaking_heart_active")
public static final Texture creakingHeartActive = new Texture();
@TexturePath("assets/minecraft/textures/block/creaking_heart_top_active")
public static final Texture creakingHeartTopActive = new Texture();

/** Banner base texture. */
public static final Texture bannerBase = new Texture();
Expand Down

0 comments on commit 2d14168

Please sign in to comment.