Skip to content

Commit 5dde522

Browse files
committed
blocks: add 1.16.1/2+ new blocks/states (#474)
Adds _some _new blocks and block states, building on the version- dependent block support added in #469. Notably, fixes grass on 1.16.4. 1.16.1+ (protocol_version >= 735) * Add NetherGoldOre * Add SoulFire * Add SoulSoil, Basalt * Add PolishedBasalt, SoulTorch, SoulWallTorch * Add Chain * 1.16.2+ (protocol_version >= 751) * Add Chain axis states
1 parent 8ca12a6 commit 5dde522

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

blocks/src/lib.rs

+92
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,12 @@ define_blocks! {
714714
props {},
715715
model { ("minecraft", "coal_ore") },
716716
}
717+
NetherGoldOre {
718+
props {},
719+
data None,
720+
offsets |protocol_version| { if protocol_version >= 735 { Some(0) } else { None } },
721+
model { ("minecraft", "nether_gold_ore") },
722+
}
717723
Log {
718724
props {
719725
variant: TreeVariant = [
@@ -1389,6 +1395,12 @@ define_blocks! {
13891395
_ => false,
13901396
},
13911397
}
1398+
SoulFire {
1399+
props {},
1400+
offsets |protocol_version| { if protocol_version >= 735 { Some(0) } else { None } },
1401+
model { ("minecraft", "soul_fire") },
1402+
collision vec![],
1403+
}
13921404
MobSpawner {
13931405
props {},
13941406
material material::NON_SOLID,
@@ -2043,6 +2055,58 @@ define_blocks! {
20432055
Point3::new(1.0, 7.0/8.0, 1.0)
20442056
)],
20452057
}
2058+
SoulSoil {
2059+
props {},
2060+
offsets |protocol_version| { if protocol_version >= 735 { Some(0) } else { None } },
2061+
model { ("minecraft", "soul_soil") },
2062+
}
2063+
Basalt {
2064+
props {
2065+
axis: Axis = [Axis::X, Axis::Y, Axis::Z],
2066+
},
2067+
data None,
2068+
offsets |protocol_version| { if protocol_version >= 735 { Some(
2069+
match axis {
2070+
Axis::X => 0,
2071+
Axis::Y => 1,
2072+
Axis::Z => 2,
2073+
_ => unreachable!()
2074+
}) } else { None } },
2075+
model { ("minecraft", "basalt") },
2076+
}
2077+
PolishedBasalt {
2078+
props {
2079+
axis: Axis = [Axis::X, Axis::Y, Axis::Z],
2080+
},
2081+
data None,
2082+
offsets |protocol_version| { if protocol_version >= 735 { Some(
2083+
match axis {
2084+
Axis::X => 0,
2085+
Axis::Y => 1,
2086+
Axis::Z => 2,
2087+
_ => unreachable!()
2088+
}) } else { None } },
2089+
model { ("minecraft", "polished_basalt") },
2090+
}
2091+
SoulTorch {
2092+
props {},
2093+
data None,
2094+
offsets |protocol_version| { if protocol_version >= 735 { Some(0) } else { None } },
2095+
model { ("minecraft", "soul_torch") },
2096+
}
2097+
SoulWallTorch {
2098+
props {
2099+
facing: Direction = [
2100+
Direction::North,
2101+
Direction::South,
2102+
Direction::West,
2103+
Direction::East
2104+
],
2105+
},
2106+
data None,
2107+
offsets |protocol_version| { if protocol_version >= 735 { Some(facing.offset()) } else { None } },
2108+
model { ("minecraft", "soul_wall_torch") },
2109+
}
20462110
Glowstone {
20472111
props {},
20482112
material Material {
@@ -2328,6 +2392,34 @@ define_blocks! {
23282392
_ => false,
23292393
},
23302394
}
2395+
Chain {
2396+
props {
2397+
waterlogged: bool = [true, false],
2398+
axis: Axis = [Axis::X, Axis::Y, Axis::Z],
2399+
},
2400+
data None,
2401+
offsets |protocol_version| {
2402+
if protocol_version >= 735 {
2403+
let o = if waterlogged { 1 } else { 0 };
2404+
if protocol_version >= 751 {
2405+
Some(match axis {
2406+
Axis::X => 0,
2407+
Axis::Y => 1,
2408+
Axis::Z => 2,
2409+
_ => unreachable!()
2410+
} * 2 + o)
2411+
} else {
2412+
match axis {
2413+
Axis::Y => Some(o),
2414+
_ => None,
2415+
}
2416+
}
2417+
} else {
2418+
None
2419+
}
2420+
},
2421+
model { ("minecraft", "chain") },
2422+
}
23312423
GlassPane {
23322424
props {
23332425
north: bool = [false, true],

0 commit comments

Comments
 (0)