Modern Apps git

← Modern-Apps.git

voxels: add Matcha silver, sulfur, cinnabar ores and the steel to adamant alloy tier

Commit
30d87250214bd736811fa064b9d1970a115c13e1
Author
Vayun Mathur <[email protected]>
When
2026-08-05 04:03 UTC (4 months ago)
Parents
384d800

Diff

games/voxels/src/main/assets/block/adamant_block.png
diff --git a/games/voxels/src/main/assets/block/adamant_block.png b/games/voxels/src/main/assets/block/adamant_block.pngnew file mode 100644index 0000000000..6fb6c9861eBinary files /dev/null and b/games/voxels/src/main/assets/block/adamant_block.png differ
games/voxels/src/main/assets/block/adamant_boots.png
diff --git a/games/voxels/src/main/assets/block/adamant_boots.png b/games/voxels/src/main/assets/block/adamant_boots.pngnew file mode 100644index 0000000000..74554cbc11Binary files /dev/null and b/games/voxels/src/main/assets/block/adamant_boots.png differ
games/voxels/src/main/assets/block/adamant_chestplate.png
diff --git a/games/voxels/src/main/assets/block/adamant_chestplate.png b/games/voxels/src/main/assets/block/adamant_chestplate.pngnew file mode 100644index 0000000000..ed3a5c5cccBinary files /dev/null and b/games/voxels/src/main/assets/block/adamant_chestplate.png differ
games/voxels/src/main/assets/block/adamant_helmet.png
diff --git a/games/voxels/src/main/assets/block/adamant_helmet.png b/games/voxels/src/main/assets/block/adamant_helmet.pngnew file mode 100644index 0000000000..775404e588Binary files /dev/null and b/games/voxels/src/main/assets/block/adamant_helmet.png differ
games/voxels/src/main/assets/block/adamant_ingot.png
diff --git a/games/voxels/src/main/assets/block/adamant_ingot.png b/games/voxels/src/main/assets/block/adamant_ingot.pngnew file mode 100644index 0000000000..6985034cc1Binary files /dev/null and b/games/voxels/src/main/assets/block/adamant_ingot.png differ
games/voxels/src/main/assets/block/adamant_leggings.png
diff --git a/games/voxels/src/main/assets/block/adamant_leggings.png b/games/voxels/src/main/assets/block/adamant_leggings.pngnew file mode 100644index 0000000000..b093659f4eBinary files /dev/null and b/games/voxels/src/main/assets/block/adamant_leggings.png differ
games/voxels/src/main/assets/block/adamant_pickaxe.png
diff --git a/games/voxels/src/main/assets/block/adamant_pickaxe.png b/games/voxels/src/main/assets/block/adamant_pickaxe.pngnew file mode 100644index 0000000000..393b787a34Binary files /dev/null and b/games/voxels/src/main/assets/block/adamant_pickaxe.png differ
games/voxels/src/main/assets/block/adamant_sword.png
diff --git a/games/voxels/src/main/assets/block/adamant_sword.png b/games/voxels/src/main/assets/block/adamant_sword.pngnew file mode 100644index 0000000000..b1efdea121Binary files /dev/null and b/games/voxels/src/main/assets/block/adamant_sword.png differ
games/voxels/src/main/assets/block/blast_furnace.png
diff --git a/games/voxels/src/main/assets/block/blast_furnace.png b/games/voxels/src/main/assets/block/blast_furnace.pngnew file mode 100644index 0000000000..2d063277edBinary files /dev/null and b/games/voxels/src/main/assets/block/blast_furnace.png differ
games/voxels/src/main/assets/block/cinnabar_ore.png
diff --git a/games/voxels/src/main/assets/block/cinnabar_ore.png b/games/voxels/src/main/assets/block/cinnabar_ore.pngnew file mode 100644index 0000000000..be214994b8Binary files /dev/null and b/games/voxels/src/main/assets/block/cinnabar_ore.png differ
games/voxels/src/main/assets/block/netherite_block.png
diff --git a/games/voxels/src/main/assets/block/netherite_block.png b/games/voxels/src/main/assets/block/netherite_block.pngnew file mode 100644index 0000000000..6fb6c9861eBinary files /dev/null and b/games/voxels/src/main/assets/block/netherite_block.png differ
games/voxels/src/main/assets/block/quicksilver.png
diff --git a/games/voxels/src/main/assets/block/quicksilver.png b/games/voxels/src/main/assets/block/quicksilver.pngnew file mode 100644index 0000000000..4761d7259dBinary files /dev/null and b/games/voxels/src/main/assets/block/quicksilver.png differ
games/voxels/src/main/assets/block/silver_block.png
diff --git a/games/voxels/src/main/assets/block/silver_block.png b/games/voxels/src/main/assets/block/silver_block.pngnew file mode 100644index 0000000000..1ac15faa91Binary files /dev/null and b/games/voxels/src/main/assets/block/silver_block.png differ
games/voxels/src/main/assets/block/silver_ingot.png
diff --git a/games/voxels/src/main/assets/block/silver_ingot.png b/games/voxels/src/main/assets/block/silver_ingot.pngnew file mode 100644index 0000000000..217935fa25Binary files /dev/null and b/games/voxels/src/main/assets/block/silver_ingot.png differ
games/voxels/src/main/assets/block/silver_ore.png
diff --git a/games/voxels/src/main/assets/block/silver_ore.png b/games/voxels/src/main/assets/block/silver_ore.pngnew file mode 100644index 0000000000..f662df9977Binary files /dev/null and b/games/voxels/src/main/assets/block/silver_ore.png differ
games/voxels/src/main/assets/block/steel_block.png
diff --git a/games/voxels/src/main/assets/block/steel_block.png b/games/voxels/src/main/assets/block/steel_block.pngnew file mode 100644index 0000000000..c59e701bbfBinary files /dev/null and b/games/voxels/src/main/assets/block/steel_block.png differ
games/voxels/src/main/assets/block/steel_ingot.png
diff --git a/games/voxels/src/main/assets/block/steel_ingot.png b/games/voxels/src/main/assets/block/steel_ingot.pngnew file mode 100644index 0000000000..e0651a54b0Binary files /dev/null and b/games/voxels/src/main/assets/block/steel_ingot.png differ
games/voxels/src/main/assets/block/sulfur.png
diff --git a/games/voxels/src/main/assets/block/sulfur.png b/games/voxels/src/main/assets/block/sulfur.pngnew file mode 100644index 0000000000..8933a26085Binary files /dev/null and b/games/voxels/src/main/assets/block/sulfur.png differ
games/voxels/src/main/assets/block/sulfur_ore.png
diff --git a/games/voxels/src/main/assets/block/sulfur_ore.png b/games/voxels/src/main/assets/block/sulfur_ore.pngnew file mode 100644index 0000000000..d6d724d43eBinary files /dev/null and b/games/voxels/src/main/assets/block/sulfur_ore.png differ
games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.ktindex 5412ec8555..79c53085c0 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/MainActivity.kt@@ -128,7 +128,7 @@ class MainActivity : ComponentActivity() {                             onPlace = { off -> try {                                 when (VoxelsNative.placeBlockAt(off.x, off.y)) {                                     1 -> com.vayunmathur.games.voxels.util.SoundFx.playPlace()-                                    11, 12 -> { invStartTab = 2; inventoryOpen = true } // crafting table / furnace+                                    11, 12, 14 -> { invStartTab = 2; inventoryOpen = true } // crafting table / furnace / blast furnace                                     13 -> { // jukebox: play the held disc (or stop)                                         val inv = try { kotlinx.serialization.json.Json { ignoreUnknownKeys = true }.decodeFromString<com.vayunmathur.games.voxels.ui.InventoryState>(inventoryJson) } catch (_: Exception) { null }                                         val held = inv?.slots?.getOrNull(inv.selected)?.id ?: 0
games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt
diff --git a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.ktindex 1f6891d313..44f0349f1e 100644--- a/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt+++ b/games/voxels/src/main/java/com/vayunmathur/games/voxels/ui/Hotbar.kt@@ -38,13 +38,14 @@ data class InvSlot(val id: Int, val count: Int) @Serializable data class InventoryState(val selected: Int = 0, val slots: List<InvSlot> = List(9) { InvSlot(0, 0) }, val armor: List<InvSlot> = emptyList()) -// Ids 163..178 are tools/armor whose slot `count` is durability (not a stack size).-fun isDurabilityItem(id: Int) = id in 163..178 || id == 186 || id == 188+// Ids 163..178 and 197..202 are tools/armor whose slot `count` is durability (not a stack size).+fun isDurabilityItem(id: Int) = id in 163..178 || id in 197..202 || id == 186 || id == 188  val maxDurability = mapOf(     163 to 60, 164 to 60, 165 to 132, 166 to 132, 167 to 250, 168 to 250, 169 to 1562, 170 to 1562,     171 to 240, 172 to 240, 173 to 240, 174 to 240, 175 to 528, 176 to 528, 177 to 528, 178 to 528,-    186 to 64, 188 to 432+    186 to 64, 188 to 432,+    197 to 2031, 198 to 2031, 199 to 666, 200 to 666, 201 to 666, 202 to 666 )  @Composable@@ -88,7 +89,13 @@ val blockNames = mapOf(     179 to "Disc: Golden", 180 to "Disc: Lullaby", 181 to "Disc: Forest", 182 to "Disc: Deep Mining",     183 to "Disc: Winter", 184 to "Disc: Piano", 185 to "Disc: Gift",     186 to "Flint & Steel", 187 to "Nether Star", 188 to "Elytra", 189 to "Firework Rocket",-    190 to "Snowball", 191 to "Ender Pearl"+    190 to "Snowball", 191 to "Ender Pearl",+    // Matcha alloy tier.+    90 to "Silver Ore", 91 to "Sulfur Ore", 92 to "Cinnabar Ore",+    93 to "Silver Block", 94 to "Steel Block", 95 to "Adamant Block", 96 to "Blast Furnace",+    192 to "Sulfur", 193 to "Silver Ingot", 194 to "Quicksilver", 195 to "Steel Ingot", 196 to "Adamant Ingot",+    197 to "Adamant Pickaxe", 198 to "Adamant Sword",+    199 to "Adamant Helmet", 200 to "Adamant Chestplate", 201 to "Adamant Leggings", 202 to "Adamant Boots" )  // Music disc item id -> track asset in assets/music/.@@ -131,21 +138,28 @@ val blockIconFile = mapOf(     179 to "music_disc_13.png", 180 to "music_disc_cat.png", 181 to "music_disc_blocks.png", 182 to "music_disc_chirp.png",     183 to "music_disc_5.png", 184 to "music_disc_11.png", 185 to "music_disc_bounce.png",     186 to "flint_and_steel.png", 187 to "nether_star.png", 188 to "elytra.png", 189 to "firework_rocket.png",-    190 to "snowball.png", 191 to "ender_pearl.png"+    190 to "snowball.png", 191 to "ender_pearl.png",+    90 to "silver_ore.png", 91 to "sulfur_ore.png", 92 to "cinnabar_ore.png",+    93 to "silver_block.png", 94 to "steel_block.png", 95 to "adamant_block.png", 96 to "blast_furnace.png",+    192 to "sulfur.png", 193 to "silver_ingot.png", 194 to "quicksilver.png", 195 to "steel_ingot.png",+    196 to "adamant_ingot.png", 197 to "adamant_pickaxe.png", 198 to "adamant_sword.png",+    199 to "adamant_helmet.png", 200 to "adamant_chestplate.png", 201 to "adamant_leggings.png", 202 to "adamant_boots.png" )  // Creative catalog, split into tabs. val catalogNatural = listOf(3, 2, 40, 46, 60, 39, 41, 71, 1, 6, 38, 36, 37, 14, 16, 17, 15, 45, 79, 75, 70,     4, 5, 26, 28, 29, 31, 47, 48, 50, 51, 80, 11, 42, 43, 44, 32, 84, 85, 13)-val catalogOres = listOf(18, 19, 20, 21, 22, 23, 24, 25, 73)+val catalogOres = listOf(18, 19, 20, 21, 22, 90, 91, 92, 23, 24, 25, 93, 94, 95, 73) val catalogOcean = listOf(61, 62, 63, 64, 65, 66, 67, 68, 69) val catalogItems = listOf(128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138,     146, 147, 148, 149, 150, 151, 152, 153,-    154, 155, 156, 157, 158, 159, 160, 161, 162, 187, 189, 190, 191)+    154, 155, 156, 157, 158, 159, 160, 161, 162, 187, 189, 190, 191,+    192, 193, 194, 195, 196) val catalogGear = listOf(163, 164, 165, 166, 167, 168, 169, 170,-    171, 172, 173, 174, 175, 176, 177, 178, 186, 188)+    171, 172, 173, 174, 175, 176, 177, 178, 186, 188,+    197, 198, 199, 200, 201, 202) val catalogMusic = listOf(82, 179, 180, 181, 182, 183, 184, 185)-val catalogBuilding = listOf(10, 27, 30, 49, 52, 8, 57, 9, 53, 54, 55, 56, 58, 59, 72, 74, 76, 77, 78, 81, 7, 33, 34, 35, 88, 89)+val catalogBuilding = listOf(10, 27, 30, 49, 52, 8, 57, 9, 53, 54, 55, 56, 58, 59, 72, 74, 76, 77, 78, 81, 7, 33, 34, 35, 96, 88, 89)  @Composable fun rememberBlockIcon(id: Int): androidx.compose.ui.graphics.ImageBitmap? {
games/voxels/src/main/rust/shaders/atlas.bin
diff --git a/games/voxels/src/main/rust/shaders/atlas.bin b/games/voxels/src/main/rust/shaders/atlas.binindex 69b858226e..efe72f1a5e 100644Binary files a/games/voxels/src/main/rust/shaders/atlas.bin and b/games/voxels/src/main/rust/shaders/atlas.bin differ
games/voxels/src/main/rust/src/engine.rs
diff --git a/games/voxels/src/main/rust/src/engine.rs b/games/voxels/src/main/rust/src/engine.rsindex 071149e67f..5ad295e386 100644--- a/games/voxels/src/main/rust/src/engine.rs+++ b/games/voxels/src/main/rust/src/engine.rs@@ -688,7 +688,7 @@ fn dim_dir(base: &str, dim: u8) -> String { // Layer k (k=1..4) at depth k must be a full (2k+1)x(2k+1) square of iron/diamond/emerald blocks // centred under the beacon. Tier stops at the first incomplete layer. fn beacon_tier(chunks: &ChunkMap, x: i32, y: i32, z: i32) -> i32 {-    let is_mineral = |id: u8| matches!(id, 23 | 24 | 25);+    let is_mineral = |id: u8| matches!(id, 23 | 24 | 25 | 93 | 94 | 95);     let mut tier = 0;     for k in 1..=4i32 {         let mut full = true;
games/voxels/src/main/rust/src/inventory.rs
diff --git a/games/voxels/src/main/rust/src/inventory.rs b/games/voxels/src/main/rust/src/inventory.rsindex 43c3ce2152..41e23bb771 100644--- a/games/voxels/src/main/rust/src/inventory.rs+++ b/games/voxels/src/main/rust/src/inventory.rs@@ -24,7 +24,7 @@ pub struct Inventory { // (in1_id, in1_count, in2_id, in2_count, out_id, out_count). in2_id == 0 means a single ingredient. // Item ids 154+ are materials/tools (see item.rs). Crafting and smelting both flow through this table // (the Furnace menu opens the same crafting UI).-pub const RECIPES: [(u8, i32, u8, i32, u8, i32); 38] = [+pub const RECIPES: [(u8, i32, u8, i32, u8, i32); 56] = [     (154, 1, 157, 1, 186, 1), // iron + coal -> flint & steel     (187, 1, Block::Glass as u8, 5, Block::Beacon as u8, 1), // nether star + glass -> beacon     (138, 2, 0, 0, 189, 3), // gunpowder -> firework rockets@@ -61,6 +61,28 @@ pub const RECIPES: [(u8, i32, u8, i32, u8, i32); 38] = [     // Armor: material only.     (154, 5, 0, 0, 171, 1), (154, 8, 0, 0, 172, 1), (154, 7, 0, 0, 173, 1), (154, 4, 0, 0, 174, 1), // iron     (155, 5, 0, 0, 175, 1), (155, 8, 0, 0, 176, 1), (155, 7, 0, 0, 177, 1), (155, 4, 0, 0, 178, 1), // diamond+    // --- Matcha alloy tier ---+    // Smelt the three new ores into their raw materials.+    (Block::SilverOre as u8,   1, 0, 0, 193 /*Silver Ingot*/, 1),+    (Block::SulfurOre as u8,   1, 0, 0, 192 /*Sulfur*/,       2),+    (Block::CinnabarOre as u8, 1, 0, 0, 194 /*Quicksilver*/,  1),+    // Iron quenched in sulfur makes steel; steel amalgamated with quicksilver makes adamant.+    (154, 1, 192, 1, 195, 1), // iron ingot + sulfur -> steel ingot+    (195, 4, 194, 2, 196, 1), // steel + quicksilver -> adamant ingot+    // Adamant gear: the tier above diamond.+    (196, 3, 159, 2, 197, 1), // adamant pickaxe+    (196, 2, 159, 1, 198, 1), // adamant sword+    (196, 5, 0, 0, 199, 1), (196, 8, 0, 0, 200, 1), (196, 7, 0, 0, 201, 1), (196, 4, 0, 0, 202, 1),+    // Metal storage blocks (silver/steel/adamant also power beacons).+    (193, 9, 0, 0, Block::SilverBlock as u8,  1),+    (195, 9, 0, 0, Block::SteelBlock as u8,   1),+    (196, 9, 0, 0, Block::AdamantBlock as u8, 1),+    // A steel-lined furnace: the only place the alloy recipes will smelt.+    (Block::Furnace as u8, 1, 195, 5, Block::BlastFurnace as u8, 1),+    // Blessings: quicksilver charms. Previously unobtainable outside the creative catalog.+    (194, 2, 193, 1, 160, 1), // quicksilver + silver -> Blessing of Swiftness+    (194, 2, 154, 4, 161, 1), // quicksilver + iron   -> Blessing of the Warrior+    (194, 2, 156, 2, 162, 1), // quicksilver + emerald-> Blessing of the Deep ];  // Villager trades: (cost_id, cost_count, give_id, give_count). Emerald = item 156.
games/voxels/src/main/rust/src/item.rs
diff --git a/games/voxels/src/main/rust/src/item.rs b/games/voxels/src/main/rust/src/item.rsindex caf978055d..702f0d63df 100644--- a/games/voxels/src/main/rust/src/item.rs+++ b/games/voxels/src/main/rust/src/item.rs@@ -28,30 +28,36 @@ impl Effect { pub struct ActiveEffect { pub kind: Effect, pub secs: f32, pub amp: u8 }  pub const ITEM_BASE: u8 = 128;+// Matcha alloy line: 192 Sulfur, 193 Silver Ingot, 194 Quicksilver, 195 Steel Ingot,+// 196 Adamant Ingot, 197/198 adamant pickaxe/sword, 199..202 adamant armor. pub fn is_item(id: u8) -> bool { id >= ITEM_BASE } pub fn is_estus(id: u8) -> bool { id == 128 } pub fn is_heart_container(id: u8) -> bool { id == 129 } pub fn is_food(id: u8) -> bool { food_effects(id).is_some() } -// ---- Tools & armor (ids 163..178) ----+// ---- Tools & armor ---- // Tools 163..170: {wood,stone,iron,diamond} x {pickaxe,sword}. Armor 171..178: {iron,diamond} x-// {helmet,chestplate,leggings,boots}. Durability is stored in the inventory slot's `count`.-pub fn is_tool(id: u8) -> bool { (163..=170).contains(&id) }-pub fn is_pickaxe(id: u8) -> bool { matches!(id, 163 | 165 | 167 | 169) }-pub fn is_sword(id: u8) -> bool { matches!(id, 164 | 166 | 168 | 170) }+// {helmet,chestplate,leggings,boots}. The Matcha adamant tier sits above diamond at 197..202.+// Durability is stored in the inventory slot's `count`.+pub fn is_tool(id: u8) -> bool { (163..=170).contains(&id) || matches!(id, 197 | 198) }+pub fn is_pickaxe(id: u8) -> bool { matches!(id, 163 | 165 | 167 | 169 | 197) }+pub fn is_sword(id: u8) -> bool { matches!(id, 164 | 166 | 168 | 170 | 198) } pub fn is_elytra(id: u8) -> bool { id == 188 }-pub fn is_armor(id: u8) -> bool { (171..=178).contains(&id) || id == 188 } // elytra occupies the chest slot-pub fn armor_slot(id: u8) -> usize { if id == 188 { 1 } else { ((id - 171) % 4) as usize } } // 0 helm, 1 chest, 2 legs, 3 boots+pub fn is_armor(id: u8) -> bool { (171..=178).contains(&id) || (199..=202).contains(&id) || id == 188 } // elytra occupies the chest slot+pub fn armor_slot(id: u8) -> usize {+    if id == 188 { 1 } else if id >= 199 { (id - 199) as usize } else { ((id - 171) % 4) as usize }+} // 0 helm, 1 chest, 2 legs, 3 boots pub fn is_flint_steel(id: u8) -> bool { id == 186 } pub fn is_firework(id: u8) -> bool { id == 189 } pub fn has_durability(id: u8) -> bool { is_tool(id) || is_armor(id) || id == 186 } -pub fn sword_damage(id: u8) -> f32 { match id { 164 => 5.0, 166 => 6.0, 168 => 7.0, 170 => 9.0, _ => 0.0 } }-pub fn pick_damage(id: u8) -> f32 { match id { 163 => 2.0, 165 => 3.0, 167 => 4.0, 169 => 5.0, _ => 0.0 } }+pub fn sword_damage(id: u8) -> f32 { match id { 164 => 5.0, 166 => 6.0, 168 => 7.0, 170 => 9.0, 198 => 11.0, _ => 0.0 } }+pub fn pick_damage(id: u8) -> f32 { match id { 163 => 2.0, 165 => 3.0, 167 => 4.0, 169 => 5.0, 197 => 6.0, _ => 0.0 } } pub fn armor_defense(id: u8) -> f32 {     match id {         171 => 2.0, 172 => 6.0, 173 => 5.0, 174 => 2.0, // iron helm/chest/legs/boots         175 => 3.0, 176 => 8.0, 177 => 6.0, 178 => 3.0, // diamond+        199 => 4.0, 200 => 9.0, 201 => 7.0, 202 => 4.0, // adamant         188 => 1.0,                                     // elytra (mostly for mobility, minor defense)         _ => 0.0,     }@@ -62,6 +68,8 @@ pub fn max_durability(id: u8) -> i32 {         171..=174 => 240, 175..=178 => 528,                                       // iron/diamond armor         186 => 64,                                                                // flint & steel         188 => 432,                                                               // elytra+        197 | 198 => 2031,                                                        // adamant tools+        199..=202 => 666,                                                         // adamant armor         _ => 0,     } }
games/voxels/src/main/rust/src/world/block.rs
diff --git a/games/voxels/src/main/rust/src/world/block.rs b/games/voxels/src/main/rust/src/world/block.rsindex cf926d50e3..74c1d5e810 100644--- a/games/voxels/src/main/rust/src/world/block.rs+++ b/games/voxels/src/main/rust/src/world/block.rs@@ -95,9 +95,18 @@ pub enum Block {     EndPortal = 87,     Beacon = 88,     Purpur = 89,+    // Matcha alloy tier: silver in the overworld, sulfur and cinnabar in the Nether, feeding the+    // steel -> adamant smithing line.+    SilverOre = 90,+    SulfurOre = 91,+    CinnabarOre = 92,+    SilverBlock = 93,+    SteelBlock = 94,+    AdamantBlock = 95,+    BlastFurnace = 96, } -pub const MAX_BLOCK_ID: u8 = 89;+pub const MAX_BLOCK_ID: u8 = 96;  impl Block {     pub fn from_id(id: u8) -> Self {@@ -111,9 +120,9 @@ impl Block {     }     pub fn is_opaque(self) -> bool { !self.is_transparent() } -    // Interactive block menu: 0 = none, 1 = crafting, 2 = furnace.+    // Interactive block menu: 0 = none, 1 = crafting, 2 = furnace, 3 = jukebox, 4 = blast furnace.     pub fn menu(self) -> i32 {-        match self { Self::CraftingTable => 1, Self::Furnace => 2, Self::Jukebox => 3, _ => 0 }+        match self { Self::CraftingTable => 1, Self::Furnace => 2, Self::Jukebox => 3, Self::BlastFurnace => 4, _ => 0 }     }      // Atlas tile indices (8x8 atlas). See the atlas generator's TILES order.@@ -209,6 +218,13 @@ impl Block {             Self::EndPortal => 123,             Self::Beacon => 124,             Self::Purpur => 125,+            Self::SilverOre => 128,+            Self::SulfurOre => 129,+            Self::CinnabarOre => 130,+            Self::SilverBlock => 131,+            Self::SteelBlock => 132,+            Self::AdamantBlock => 133,+            Self::BlastFurnace => 134,         }     }     pub fn tile_bottom(self) -> u32 {@@ -220,6 +236,7 @@ impl Block {             Self::Bookshelf => 10,             Self::CraftingTable => 10,             Self::Furnace => 43,+            Self::BlastFurnace => 135,             Self::Sandstone => 69,             Self::Podzol => 1,             Self::Mycelium => 1,@@ -244,6 +261,7 @@ impl Block {             Self::JungleLog => 85,             Self::HayBlock => 93,             Self::Farmland => 1,+            Self::BlastFurnace => 135,             _ => self.tile_top(),         }     }@@ -265,7 +283,8 @@ impl Block {             | Self::IronBlock | Self::DiamondBlock | Self::EmeraldBlock | Self::Netherrack | Self::Furnace             | Self::RedSandstone | Self::Sandstone | Self::GraniteBricks | Self::DeepslateBricks | Self::NetherBricks             | Self::EndStoneBricks | Self::CobbledDeepslate | Self::Prismarine | Self::DarkPrismarine | Self::Dripstone-            | Self::Amethyst | Self::Calcite | Self::Tuff | Self::Magma | Self::Obsidian | Self::PackedIce | Self::BlueIce | Self::Purpur)+            | Self::Amethyst | Self::Calcite | Self::Tuff | Self::Magma | Self::Obsidian | Self::PackedIce | Self::BlueIce | Self::Purpur+            | Self::SilverOre | Self::SulfurOre | Self::CinnabarOre | Self::SilverBlock | Self::SteelBlock | Self::AdamantBlock | Self::BlastFurnace)     }     // Block light emitted (0..15) for dynamic lighting.     pub fn light_emission(self) -> u8 {
games/voxels/src/main/rust/src/world/generator.rs
diff --git a/games/voxels/src/main/rust/src/world/generator.rs b/games/voxels/src/main/rust/src/world/generator.rsindex 6cb351990c..a1bfb08982 100644--- a/games/voxels/src/main/rust/src/world/generator.rs+++ b/games/voxels/src/main/rust/src/world/generator.rs@@ -286,9 +286,10 @@ pub struct TerrainGen { // Ore/stone-variant veins, richest first so a rare vein wins where two overlap. // (block id, noise offset, noise scale, threshold, min y, max y) type Vein = (u8, f64, f64, f64, i32, i32);-const OVERWORLD_VEINS: [Vein; 8] = [+const OVERWORLD_VEINS: [Vein; 9] = [     (22, 947.0, 0.115, 0.80, 62, 118), // emerald — mountains only, the rarest surface find     (20, 823.0, 0.105, 0.78,  5,  20), // diamond — deepest+    (90, 179.0, 0.095, 0.76,  5,  58), // silver — rarer than iron, never near the surface     (21, 601.0, 0.100, 0.72,  5,  30), // redstone     (19, 137.0, 0.090, 0.68,  5,  74), // iron     (18,   7.0, 0.080, 0.62,  5, 112), // coal — large shallow seams@@ -296,6 +297,11 @@ const OVERWORLD_VEINS: [Vein; 8] = [     (16, 419.0, 0.055, 0.66,  5,  96), // diorite blobs     (75, 733.0, 0.050, 0.66,  5,  34), // tuff blobs, deep ];+// Nether ores: cinnabar and sulfur, the feedstock for the alloy line.+const NETHER_VEINS: [Vein; 2] = [+    (92, 271.0, 0.100, 0.74, 4, 118), // cinnabar+    (91, 563.0, 0.090, 0.68, 4, 118), // sulfur+]; // Below this depth plain stone becomes deepslate (with a noisy transition band above it). const DEEPSLATE_Y: i32 = 16; @@ -500,7 +506,9 @@ impl TerrainGen {                     if y <= LAVA { chunk.set_block(dx, yy, dz, 84); } // lava sea in the open low area                 } else {                     // Magma near the lava line, netherrack elsewhere.-                    let id = if y <= LAVA + 1 && n > 0.02 { 76 } else { 32 };+                    let id = if y <= LAVA + 1 && n > 0.02 { 76 } else {+                        self.stone_at(&NETHER_VEINS, wx, y, wz, 32)+                    };                     chunk.set_block(dx, yy, dz, id);                 }             }@@ -937,6 +945,7 @@ mod tests {             (21u8, "redstone", 0.02, 0.6),             (20u8, "diamond", 0.005, 0.3),             (22u8, "emerald", 0.002, 0.3),+            (90u8, "silver", 0.02, 0.8),         ] {             let p = pct(id);             println!("{name}: {p:.4}%");@@ -944,4 +953,28 @@ mod tests {         }         assert!(pct(57) > 5.0, "deepslate should fill the lower world, got {:.2}%", pct(57));     }++    // The Nether must actually yield the alloy feedstock, or steel and adamant are unreachable.+    #[test]+    fn nether_ores_are_reachable() {+        let gen = TerrainGen::new_dim(999, 1);+        let (mut sulfur, mut cinnabar, mut total) = (0u32, 0u32, 0u32);+        for wx in (-192..192).step_by(3) {+            for wz in (-192..192).step_by(3) {+                for y in (5..118).step_by(4) {+                    total += 1;+                    match gen.stone_at(&NETHER_VEINS, wx as f64, y, wz as f64, 32) {+                        91 => sulfur += 1,+                        92 => cinnabar += 1,+                        _ => {}+                    }+                }+            }+        }+        let sp = sulfur as f64 * 100.0 / total as f64;+        let cp = cinnabar as f64 * 100.0 / total as f64;+        println!("sulfur: {sp:.4}%  cinnabar: {cp:.4}%");+        assert!((0.05..3.0).contains(&sp), "sulfur at {sp:.4}%");+        assert!((0.02..2.0).contains(&cp), "cinnabar at {cp:.4}%");+    } }
scripts/voxels/build_atlas.py
diff --git a/scripts/voxels/build_atlas.py b/scripts/voxels/build_atlas.pyindex 74a94340d2..ed0dacf47e 100644--- a/scripts/voxels/build_atlas.py+++ b/scripts/voxels/build_atlas.py@@ -15,6 +15,7 @@ import os, struct, zlib, shutil  ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) PACK = os.path.join(ROOT, "tmp/Matcha_Flavoured/assets/minecraft/textures/block")+PACK_ITEM = os.path.join(ROOT, "tmp/Matcha_Flavoured/assets/minecraft/textures/item") ATLAS_BIN = os.path.join(ROOT, "games/voxels/src/main/rust/shaders/atlas.bin") ASSETS = os.path.join(ROOT, "games/voxels/src/main/assets/block") @@ -62,6 +63,7 @@ NEW_TILES = {     95: "farmland.png",     96: "packed_dirt.png",     116: "azalea_leaves.png",+    133: "netherite_block.png", }  # Procedurally generated tiles (index -> base RGB) for blocks the pack lacks textures for (coral,@@ -98,6 +100,39 @@ PROC_TILES = {     125: (170, 116, 172),  # purpur (muted purple)     126: (214, 66, 66),    # firework rocket icon (red) — item only, tile unused by any block     127: (226, 238, 250),  # snowball icon (near-white) — item only+    131: (198, 202, 214),  # silver block (pale metal)+    132: (86, 92, 104),    # steel block (blue-gray)+    134: (58, 54, 62),     # blast furnace top (dark iron)+    135: (44, 42, 48),     # blast furnace side+}++# Ore tiles: a stone/netherrack base with deterministic mineral blobs speckled over it, so new ores+# read like the pack's real ore textures rather than a flat colour.+# index -> (base tile index, mineral rgb, blob seed)+ORE_TILES = {+    128: (0, (214, 220, 232), 0x511E),   # silver ore in stone+    129: (37, (238, 214, 62), 0x5F1F),   # sulfur ore in netherrack+    130: (37, (196, 40, 44), 0xC14B),    # cinnabar ore in netherrack+}++# Blocks and items whose icon comes straight from a pack PNG. dest filename -> (subdir, source).+COPY_ICONS = {+    "adamant_block.png": ("block", "netherite_block.png"),+    "adamant_ingot.png": ("item", "netherite_ingot.png"),+    "adamant_pickaxe.png": ("item", "adamant_mattock.png"),+    "adamant_sword.png": ("item", "adamant_claymore.png"),+    "adamant_helmet.png": ("item", "netherite_helmet.png"),+    "adamant_chestplate.png": ("item", "netherite_chestplate.png"),+    "adamant_leggings.png": ("item", "netherite_leggings.png"),+    "adamant_boots.png": ("item", "netherite_boots.png"),+    "silver_ingot.png": ("item", "prismarine_crystals.png"),+    "quicksilver.png": ("item", "prismarine_shard.png"),+}++# Item-only icons with no atlas tile (items are never placed as blocks). filename -> base rgb.+PROC_ITEM_ICON = {+    "sulfur.png": (238, 214, 62),+    "steel_ingot.png": (118, 126, 140), }  @@ -109,6 +144,8 @@ PROC_ICON = {     109: "amethyst.png", 110: "calcite.png", 111: "tuff.png", 112: "magma.png", 113: "glowstone.png",     114: "obsidian.png", 115: "clay.png", 117: "warding_stone.png", 118: "jukebox.png", 119: "chest.png",     120: "lava.png", 121: "end_stone.png", 124: "beacon.png", 125: "purpur_block.png", 126: "firework_rocket.png", 127: "snowball.png",+    128: "silver_ore.png", 129: "sulfur_ore.png", 130: "cinnabar_ore.png",+    131: "silver_block.png", 132: "steel_block.png", 134: "blast_furnace.png", }  @@ -143,6 +180,41 @@ def make_proc_tile(rgb):     return out  +def read_tile(atlas, tile_index):+    """Copy a 16x16 RGBA tile out of the packed atlas."""+    col, row = tile_index % NEW_COLS, tile_index // NEW_COLS+    out = bytearray(TILE * TILE * 4)+    for ty in range(TILE):+        s = ((row * TILE + ty) * NEW_W + col * TILE) * 4+        out[ty*TILE*4:(ty+1)*TILE*4] = atlas[s:s + TILE*4]+    return out+++def make_ore_tile(base, rgb, seed):+    """Speckle mineral blobs over a base stone tile so it reads as an ore vein."""+    out = bytearray(base)+    r, g, b = rgb+    h = seed & 0xFFFFFFFF+    def rnd(limit):+        nonlocal h+        h = (h * 1103515245 + 12345) & 0x7FFFFFFF+        return h % limit+    for _ in range(8):+        cx, cy, rad = rnd(TILE), rnd(TILE), 1 + rnd(2)+        for y in range(cy - rad, cy + rad + 1):+            for x in range(cx - rad, cx + rad + 1):+                if not (0 <= x < TILE and 0 <= y < TILE): continue+                if (x - cx) ** 2 + (y - cy) ** 2 > rad * rad: continue+                # Keep the base tile's own luminance variation so the ore isn't a flat blob.+                o = (y * TILE + x) * 4+                shade = (base[o] + base[o+1] + base[o+2]) / 765.0 * 0.4 + 0.8+                out[o]   = max(0, min(255, int(r * shade)))+                out[o+1] = max(0, min(255, int(g * shade)))+                out[o+2] = max(0, min(255, int(b * shade)))+                out[o+3] = 255+    return out++ def _paeth(a, b, c):     p = a + b - c     pa, pb, pc = abs(p - a), abs(p - b), abs(p - c)@@ -293,6 +365,22 @@ def main():             write_png(os.path.join(ASSETS, PROC_ICON[idx]), TILE, TILE, tile)         print("tile %3d <- proc %s" % (idx, rgb)) +    for idx, (base_idx, rgb, seed) in sorted(ORE_TILES.items()):+        tile = make_ore_tile(read_tile(new, base_idx), rgb, seed)+        blit(new, NEW_W, idx, NEW_COLS, tile, TILE)+        if idx in PROC_ICON:+            write_png(os.path.join(ASSETS, PROC_ICON[idx]), TILE, TILE, tile)+        print("tile %3d <- ore over tile %d %s" % (idx, base_idx, rgb))++    for name, rgb in sorted(PROC_ITEM_ICON.items()):+        write_png(os.path.join(ASSETS, name), TILE, TILE, make_proc_tile(rgb))+        print("icon %s <- proc %s" % (name, rgb))++    for dest, (subdir, src_name) in sorted(COPY_ICONS.items()):+        src = os.path.join(PACK if subdir == "block" else PACK_ITEM, src_name)+        shutil.copyfile(src, os.path.join(ASSETS, dest))+        print("icon %s <- %s/%s" % (dest, subdir, src_name))+     open(ATLAS_BIN, "wb").write(new)     print("wrote %s (%dx%d, %d bytes)" % (ATLAS_BIN, NEW_W, NEW_H, len(new)))