Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ private static void addBlock(String name, Texture texture) {
addBlock("pale_oak_planks", Texture.paleOakPlanks);
addBlock("pale_oak_slab", (name, tag) -> slab(tag, Texture.paleOakPlanks));
addBlock("pale_oak_stairs", (name, tag) -> stairs(tag, Texture.paleOakPlanks));
addBlock("pale_oak_pressure_plate", (name, tag) -> pressurePlate(tag, Texture.sprucePlanks));
addBlock("pale_oak_pressure_plate", (name, tag) -> pressurePlate(tag, Texture.paleOakPlanks));
addBlock("pale_oak_fence", (name, tag) -> fence(tag, Texture.paleOakPlanks));
addBlock("pale_oak_fence_gate", (name, tag) -> fenceGate(tag, Texture.paleOakPlanks));
addBlock("pale_oak_trapdoor", (name, tag) -> orientableTrapdoor(tag, Texture.paleOakTrapdoor));
Expand Down Expand Up @@ -1297,6 +1297,70 @@ private static void addBlock(String name, Texture texture) {
propertiesTag.get("thickness").stringValue("tip"),
propertiesTag.get("vertical_direction").stringValue("up"));
});

// 26.3 Wilderness Bound
addBlock("poplar_sapling", (name, tag) -> new SpriteBlock(name, Texture.poplarSapling));
addBlock("potted_poplar_sapling", (name, tag) -> new FlowerPot(name, FlowerPotModel.Kind.POPLAR_SAPLING));
addBlock("red_poplar_leaves", (name, tag) -> new UntintedLeaves(name, Texture.redPoplarLeaves));
addBlock("orange_poplar_leaves", (name, tag) -> new UntintedLeaves(name, Texture.orangePoplarLeaves));
addBlock("yellow_poplar_leaves", (name, tag) -> new UntintedLeaves(name, Texture.yellowPoplarLeaves));
addBlock("poplar_log", (name, tag) -> log(tag, Texture.poplarLog, Texture.poplarLogTop));
addBlock("stripped_poplar_log", (name, tag) -> log(tag, Texture.strippedPoplarLog, Texture.strippedPoplarLogTop));
addBlock("poplar_wood", (name, tag) -> log(tag, Texture.poplarLog, Texture.poplarLog));
addBlock("stripped_poplar_wood", (name, tag) -> log(tag, Texture.strippedPoplarLog, Texture.strippedPoplarLog));
addBlock("poplar_planks", Texture.poplarPlanks);
addBlock("poplar_stairs", (name, tag) -> stairs(tag, Texture.poplarPlanks));
addBlock("poplar_slab", (name, tag) -> slab(tag, Texture.poplarPlanks));
addBlock("poplar_sign", (name, tag) -> sign(tag, "poplar"));
addBlock("poplar_wall_sign", (name, tag) -> wallSign(tag, "poplar"));
addBlock("poplar_hanging_sign", (name, tag) -> hangingSign(tag, "poplar"));
addBlock("poplar_wall_hanging_sign", (name, tag) -> wallHangingSign(tag, "poplar"));
addBlock("poplar_button", (name, tag) -> button(tag, Texture.poplarPlanks));
addBlock("poplar_pressure_plate", (name, tag) -> pressurePlate(tag, Texture.poplarPlanks));
addBlock("poplar_door", (name, tag) -> door(tag, Texture.poplarDoorTop, Texture.poplarDoorBottom));
addBlock("poplar_fence", (name, tag) -> fence(tag, Texture.poplarPlanks));
addBlock("poplar_fence_gate", (name, tag) -> fenceGate(tag, Texture.poplarPlanks));
addBlock("poplar_trapdoor", (name, tag) -> orientableTrapdoor(tag, Texture.poplarTrapdoor));
addBlock("poplar_shelf", (name, tag) -> shelf(tag, Texture.poplarShelf));
addBlock("red_shrub", (name, tag) -> new SpriteBlock(name, Texture.redShrub));
addBlock("shelf_mushroom", (name, tag) -> {
Tag propertiesTag = BlockSpec.getPropertiesTag(tag);
int age = BlockProvider.stringToInt(propertiesTag.get("age"), 0);
return new ShelfMushroom(name, BlockProvider.facing(tag), age);
});
addBlock("white_wool_stairs", (name, tag) -> stairs(tag, Texture.whiteWool));
addBlock("light_gray_wool_stairs", (name, tag) -> stairs(tag, Texture.lightGrayWool));
addBlock("gray_wool_stairs", (name, tag) -> stairs(tag, Texture.grayWool));
addBlock("black_wool_stairs", (name, tag) -> stairs(tag, Texture.blackWool));
addBlock("brown_wool_stairs", (name, tag) -> stairs(tag, Texture.brownWool));
addBlock("red_wool_stairs", (name, tag) -> stairs(tag, Texture.redWool));
addBlock("orange_wool_stairs", (name, tag) -> stairs(tag, Texture.orangeWool));
addBlock("yellow_wool_stairs", (name, tag) -> stairs(tag, Texture.yellowWool));
addBlock("lime_wool_stairs", (name, tag) -> stairs(tag, Texture.limeWool));
addBlock("green_wool_stairs", (name, tag) -> stairs(tag, Texture.greenWool));
addBlock("cyan_wool_stairs", (name, tag) -> stairs(tag, Texture.cyanWool));
addBlock("light_blue_wool_stairs", (name, tag) -> stairs(tag, Texture.lightBlueWool));
addBlock("blue_wool_stairs", (name, tag) -> stairs(tag, Texture.blueWool));
addBlock("purple_wool_stairs", (name, tag) -> stairs(tag, Texture.purpleWool));
addBlock("magenta_wool_stairs", (name, tag) -> stairs(tag, Texture.magentaWool));
addBlock("pink_wool_stairs", (name, tag) -> stairs(tag, Texture.pinkWool));

addBlock("white_wool_slab", (name, tag) -> slab(tag, Texture.whiteWool));
addBlock("light_gray_wool_slab", (name, tag) -> slab(tag, Texture.lightGrayWool));
addBlock("gray_wool_slab", (name, tag) -> slab(tag, Texture.grayWool));
addBlock("black_wool_slab", (name, tag) -> slab(tag, Texture.blackWool));
addBlock("brown_wool_slab", (name, tag) -> slab(tag, Texture.brownWool));
addBlock("red_wool_slab", (name, tag) -> slab(tag, Texture.redWool));
addBlock("orange_wool_slab", (name, tag) -> slab(tag, Texture.orangeWool));
addBlock("yellow_wool_slab", (name, tag) -> slab(tag, Texture.yellowWool));
addBlock("lime_wool_slab", (name, tag) -> slab(tag, Texture.limeWool));
addBlock("green_wool_slab", (name, tag) -> slab(tag, Texture.greenWool));
addBlock("cyan_wool_slab", (name, tag) -> slab(tag, Texture.cyanWool));
addBlock("light_blue_wool_slab", (name, tag) -> slab(tag, Texture.lightBlueWool));
addBlock("blue_wool_slab", (name, tag) -> slab(tag, Texture.blueWool));
addBlock("purple_wool_slab", (name, tag) -> slab(tag, Texture.purpleWool));
addBlock("magenta_wool_slab", (name, tag) -> slab(tag, Texture.magentaWool));
addBlock("pink_wool_slab", (name, tag) -> slab(tag, Texture.pinkWool));
}

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

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

public class ShelfMushroom extends AbstractModelBlock {
private final String description;

public ShelfMushroom(String name, String facing, int age) {
super(name, Texture.shelfMushroomStage1);
solid = false;
this.description = String.format("facing=%s, age=%d", facing, age);
this.model = new ShelfMushroomModel(facing, age);
}

@Override
public String description() {
return description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import se.llbit.nbt.CompoundTag;

import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;

public class HangingSignEntity extends Entity {
Expand Down Expand Up @@ -336,6 +335,8 @@ public static Texture textureFromMaterial(String material) {
return Texture.cherryHangingSign;
case "pale_oak":
return Texture.paleOakHangingSign;
case "poplar":
return Texture.poplarHangingSign;
default:
throw new IllegalArgumentException("Unknown hanging sign material: " + material);
}
Expand Down
2 changes: 2 additions & 0 deletions chunky/src/java/se/llbit/chunky/entity/SignEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,8 @@ public static Texture textureFromMaterial(String material) {
return Texture.cherrySignPost;
case "pale_oak":
return Texture.paleOakSignPost;
case "poplar":
return Texture.poplarSignPost;
default:
throw new IllegalArgumentException("Unknown sign material: " + material);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public enum Kind {
CLOSED_EYEBLOSSOM,
OPEN_EYEBLOSSOM,
GOLDEN_DANDELION,
POPLAR_SAPLING,
}

private static final Texture flowerpot = Texture.flowerPot;
Expand Down Expand Up @@ -641,6 +642,8 @@ private FlowerPotModel(Kind kind) {
case GOLDEN_DANDELION:
Arrays.fill(textures, flowerPotTex.length, textures.length, Texture.goldenDandelion);
break;
case POPLAR_SAPLING:
Arrays.fill(textures, flowerPotTex.length, textures.length, Texture.poplarSapling);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
package se.llbit.chunky.model.minecraft;

import org.apache.commons.math3.util.FastMath;
import se.llbit.chunky.model.Model;
import se.llbit.chunky.model.QuadModel;
import se.llbit.chunky.resources.Texture;
import se.llbit.math.Quad;
import se.llbit.math.Vector3;
import se.llbit.math.Vector4;

import java.util.Arrays;

public class ShelfMushroomModel extends QuadModel {
private static final Quad[][] mushroom = new Quad[][] {
// age 0
{
// top
new Quad(
new Vector3(13 / 16.0, 9 / 16.0, 9 / 16.0),
new Vector3(3 / 16.0, 9 / 16.0, 9 / 16.0),
new Vector3(13 / 16.0, 11 / 16.0, 9 / 16.0),
new Vector4(5 / 16.0, 10 / 16.0, 13 / 16.0, 14 / 16.0)
),
new Quad(
new Vector3(13 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector3(13 / 16.0, 9 / 16.0, 9 / 16.0),
new Vector3(13 / 16.0, 11 / 16.0, 16 / 16.0),
new Vector4(5 / 16.0, 8.5 / 16.0, 15 / 16.0, 16 / 16.0)
),
new Quad(
new Vector3(3 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector3(13 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector3(3 / 16.0, 11 / 16.0, 16 / 16.0),
new Vector4(5 / 16.0, 10 / 16.0, 12 / 16.0, 13 / 16.0)
),
new Quad(
new Vector3(3 / 16.0, 9 / 16.0, 9 / 16.0),
new Vector3(3 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector3(3 / 16.0, 11 / 16.0, 9 / 16.0),
new Vector4(5 / 16.0, 8.5 / 16.0, 14 / 16.0, 15 / 16.0)
),
new Quad(
new Vector3(13 / 16.0, 11 / 16.0, 9 / 16.0),
new Vector3(3 / 16.0, 11 / 16.0, 9 / 16.0),
new Vector3(13 / 16.0, 11 / 16.0, 16 / 16.0),
new Vector4(0 / 16.0, 5 / 16.0, 12.5 / 16.0, 16 / 16.0)
),
new Quad(
new Vector3(3 / 16.0, 9 / 16.0, 9 / 16.0),
new Vector3(13 / 16.0, 9 / 16.0, 9 / 16.0),
new Vector3(3 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector4(5 / 16.0, 0 / 16.0, 9 / 16.0, 12.5 / 16.0)
),
// bottom
new Quad(
new Vector3(11 / 16.0, 8 / 16.0, 12 / 16.0),
new Vector3(5 / 16.0, 8 / 16.0, 12 / 16.0),
new Vector3(11 / 16.0, 9 / 16.0, 12 / 16.0),
new Vector4(5 / 16.0, 8 / 16.0, 10.5 / 16.0, 11 / 16.0)
),
new Quad(
new Vector3(11 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(11 / 16.0, 8 / 16.0, 12 / 16.0),
new Vector3(11 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector4(5 / 16.0, 7 / 16.0, 11.5 / 16.0, 12 / 16.0)
),
new Quad(
new Vector3(5 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(11 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(5 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector4(5 / 16.0, 8 / 16.0, 10 / 16.0, 10.5 / 16.0)
),
new Quad(
new Vector3(5 / 16.0, 8 / 16.0, 12 / 16.0),
new Vector3(5 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(5 / 16.0, 9 / 16.0, 12 / 16.0),
new Vector4(5 / 16.0, 7 / 16.0, 11 / 16.0, 11.5 / 16.0)
),
new Quad(
new Vector3(11 / 16.0, 9 / 16.0, 12 / 16.0),
new Vector3(5 / 16.0, 9 / 16.0, 12 / 16.0),
new Vector3(11 / 16.0, 9 / 16.0, 16 / 16.0),
new Vector4(0 / 16.0, 3 / 16.0, 7 / 16.0, 9 / 16.0)
),
new Quad(
new Vector3(5 / 16.0, 8 / 16.0, 12 / 16.0),
new Vector3(11 / 16.0, 8 / 16.0, 12 / 16.0),
new Vector3(5 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector4(3 / 16.0, 0 / 16.0, 5 / 16.0, 7 / 16.0)
)
},
// age 1
{
// top
new Quad(
new Vector3(15 / 16.0, 8 / 16.0, 6 / 16.0),
new Vector3(1 / 16.0, 8 / 16.0, 6 / 16.0),
new Vector3(15 / 16.0, 11 / 16.0, 6 / 16.0),
new Vector4(7 / 16.0, 14 / 16.0, 11.5 / 16.0, 13 / 16.0)
),
new Quad(
new Vector3(15 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(15 / 16.0, 8 / 16.0, 6 / 16.0),
new Vector3(15 / 16.0, 11 / 16.0, 16 / 16.0),
new Vector4(7 / 16.0, 12 / 16.0, 14.5 / 16.0, 16 / 16.0)
),
new Quad(
new Vector3(1 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(15 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(1 / 16.0, 11 / 16.0, 16 / 16.0),
new Vector4(7 / 16.0, 14 / 16.0, 10 / 16.0, 11.5 / 16.0)
),
new Quad(
new Vector3(1 / 16.0, 8 / 16.0, 6 / 16.0),
new Vector3(1 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector3(1 / 16.0, 11 / 16.0, 6 / 16.0),
new Vector4(7 / 16.0, 12 / 16.0, 13 / 16.0, 14.5 / 16.0)
),
new Quad(
new Vector3(15 / 16.0, 11 / 16.0, 6 / 16.0),
new Vector3(1 / 16.0, 11 / 16.0, 6 / 16.0),
new Vector3(15 / 16.0, 11 / 16.0, 16 / 16.0),
new Vector4(0 / 16.0, 7 / 16.0, 11 / 16.0, 16 / 16.0)
),
new Quad(
new Vector3(1 / 16.0, 8 / 16.0, 6 / 16.0),
new Vector3(15 / 16.0, 8 / 16.0, 6 / 16.0),
new Vector3(1 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector4(7 / 16.0, 0 / 16.0, 6 / 16.0, 11 / 16.0)
),
// bottom
new Quad(
new Vector3(12 / 16.0, 6 / 16.0, 10 / 16.0),
new Vector3(4 / 16.0, 6 / 16.0, 10 / 16.0),
new Vector3(12 / 16.0, 8 / 16.0, 10 / 16.0),
new Vector4(4 / 16.0, 8 / 16.0, 3 / 16.0, 4 / 16.0)
),
new Quad(
new Vector3(12 / 16.0, 6 / 16.0, 16 / 16.0),
new Vector3(12 / 16.0, 6 / 16.0, 10 / 16.0),
new Vector3(12 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector4(4 / 16.0, 7 / 16.0, 5 / 16.0, 6 / 16.0)
),
new Quad(
new Vector3(4 / 16.0, 6 / 16.0, 16 / 16.0),
new Vector3(12 / 16.0, 6 / 16.0, 16 / 16.0),
new Vector3(4 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector4(4 / 16.0, 8 / 16.0, 2 / 16.0, 3 / 16.0)
),
new Quad(
new Vector3(4 / 16.0, 6 / 16.0, 10 / 16.0),
new Vector3(4 / 16.0, 6 / 16.0, 16 / 16.0),
new Vector3(4 / 16.0, 8 / 16.0, 10 / 16.0),
new Vector4(4 / 16.0, 7 / 16.0, 4 / 16.0, 5 / 16.0)
),
new Quad(
new Vector3(12 / 16.0, 8 / 16.0, 10 / 16.0),
new Vector3(4 / 16.0, 8 / 16.0, 10 / 16.0),
new Vector3(12 / 16.0, 8 / 16.0, 16 / 16.0),
new Vector4(0 / 16.0, 4 / 16.0, 3 / 16.0, 6 / 16.0)
),
new Quad(
new Vector3(4 / 16.0, 6 / 16.0, 10 / 16.0),
new Vector3(12 / 16.0, 6 / 16.0, 10 / 16.0),
new Vector3(4 / 16.0, 6 / 16.0, 16 / 16.0),
new Vector4(4 / 16.0, 0 / 16.0, 0 / 16.0, 3 / 16.0)
)
}
};

private final Quad[] quads;
private final Texture[] textures;

public ShelfMushroomModel(String facing, int age) {
switch (facing) {
case "east" -> quads = Model.rotateY(mushroom[age], FastMath.toRadians(-90));
case "south" -> quads = Model.rotateY(mushroom[age], FastMath.toRadians(180));
case "west" -> quads = Model.rotateY(mushroom[age], FastMath.toRadians(-270));
default -> quads = mushroom[age];
}

textures = new Texture[quads.length];
Arrays.fill(textures, age == 1 ? Texture.shelfMushroomStage1 : Texture.shelfMushroomStage0);
}

@Override
public Quad[] getQuads() {
return quads;
}

@Override
public Texture[] getTextures() {
return textures;
}
}
36 changes: 36 additions & 0 deletions chunky/src/java/se/llbit/chunky/resources/Texture.java
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,42 @@ public class Texture {
@TexturePath("assets/minecraft/textures/block/sulfur_spike_up_tip_merge")
public static final Texture sulfurSpikeUpTipMerge = new Texture();

// [26.3 (Wilderness Bound)]
@TexturePath("assets/minecraft/textures/block/poplar_sapling")
public static final Texture poplarSapling = new Texture();
@TexturePath("assets/minecraft/textures/block/red_poplar_leaves")
public static final Texture redPoplarLeaves = new Texture();
@TexturePath("assets/minecraft/textures/block/orange_poplar_leaves")
public static final Texture orangePoplarLeaves = new Texture();
@TexturePath("assets/minecraft/textures/block/yellow_poplar_leaves")
public static final Texture yellowPoplarLeaves = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_log")
public static final Texture poplarLog = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_log_top")
public static final Texture poplarLogTop = new Texture();
@TexturePath("assets/minecraft/textures/block/stripped_poplar_log")
public static final Texture strippedPoplarLog = new Texture();
@TexturePath("assets/minecraft/textures/block/stripped_poplar_log_top")
public static final Texture strippedPoplarLogTop = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_planks")
public static final Texture poplarPlanks = new Texture();
public static final Texture poplarSignPost = new Texture();
public static final Texture poplarHangingSign = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_door_top")
public static final Texture poplarDoorTop = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_door_bottom")
public static final Texture poplarDoorBottom = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_trapdoor")
public static final Texture poplarTrapdoor = new Texture();
@TexturePath("assets/minecraft/textures/block/poplar_shelf")
public static final Texture poplarShelf = new Texture();
@TexturePath("assets/minecraft/textures/block/red_shrub")
public static final Texture redShrub = new Texture();
@TexturePath("assets/minecraft/textures/block/shelf_mushroom_stage0")
public static final Texture shelfMushroomStage0 = new Texture();
@TexturePath("assets/minecraft/textures/block/shelf_mushroom_stage1")
public static final Texture shelfMushroomStage1 = new Texture();

@TexturePath("assets/minecraft/textures/entity/equipment/wings/elytra")
public static final Texture elytra = new Texture();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3249,6 +3249,7 @@ public class TexturePackLoader {
ALL_TEXTURES.put("sign_bamboo", SignTexture.createSignTextureLoader("bamboo", Texture.bambooSignPost));
ALL_TEXTURES.put("sign_cherry", SignTexture.createSignTextureLoader("cherry", Texture.cherrySignPost));
ALL_TEXTURES.put("sign_pale_oak", SignTexture.createSignTextureLoader("pale_oak", Texture.paleOakSignPost));
ALL_TEXTURES.put("sign_poplar", SignTexture.createSignTextureLoader("poplar", Texture.poplarSignPost));

ALL_TEXTURES.put("hanging_sign_acacia", SignTexture.createHangingSignTextureLoader("acacia", Texture.acaciaHangingSign));
ALL_TEXTURES.put("hanging_sign_birch", SignTexture.createHangingSignTextureLoader("birch", Texture.birchHangingSign));
Expand All @@ -3262,6 +3263,7 @@ public class TexturePackLoader {
ALL_TEXTURES.put("hanging_sign_bamboo", SignTexture.createHangingSignTextureLoader("bamboo", Texture.bambooHangingSign));
ALL_TEXTURES.put("hanging_sign_cherry", SignTexture.createHangingSignTextureLoader("cherry", Texture.cherryHangingSign));
ALL_TEXTURES.put("hanging_sign_pale_oak", SignTexture.createHangingSignTextureLoader("pale_oak", Texture.paleOakHangingSign));
ALL_TEXTURES.put("hanging_sign_poplar", SignTexture.createHangingSignTextureLoader("poplar", Texture.poplarHangingSign));

ALL_TEXTURES.put("cartography_table_side1",
new SimpleTexture("assets/minecraft/textures/block/cartography_table_side1",
Expand Down
Loading