#1479: Use custom #isBlock method in legacy init instead of the one in Material, since it relies on legacy being init

This commit is contained in:
DerFrZocker 2024-09-20 07:17:47 +10:00 committed by md_5
parent 98c57cbbee
commit bb3284a894
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -331,7 +331,7 @@ public final class CraftLegacy {
}
// Handle blocks
if (material.isBlock()) {
if (isBlock(material)) { // Use custom method instead of Material#isBlock since it relies on this being already run
for (byte data = 0; data < 16; data++) {
MaterialData matData = new MaterialData(material, data);
Dynamic blockTag = DataConverterFlattenData.getTag(material.getId() << 4 | data);
@ -438,6 +438,12 @@ public final class CraftLegacy {
}
}
private static boolean isBlock(Material material) {
// From Material#isBlock before the rewrite to ItemType / BlockType
// Git hash: 42f6cdf4c5dcdd52a27543403dcd17fb60311621
return 0 <= material.getId() && material.getId() < 256;
}
public static void main(String[] args) {
System.err.println("");
}