Add some notes for the extended collision box impl

Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
Joshua Castle 2023-03-07 22:26:12 -08:00
parent 7c3ceadbb8
commit 06db476f60
No known key found for this signature in database
GPG key ID: F674F38216C35D5D
2 changed files with 6 additions and 0 deletions

View file

@ -134,6 +134,11 @@ public final class BlockRegistryPopulator {
NbtMap tag = customBlockStates.get(i); NbtMap tag = customBlockStates.get(i);
CustomBlockState blockState = customExtBlockStates.get(i); CustomBlockState blockState = customExtBlockStates.get(i);
customBlockStateIds.put(blockState, blockStateOrderedMap.getOrDefault(tag, -1)); customBlockStateIds.put(blockState, blockStateOrderedMap.getOrDefault(tag, -1));
// At this point, we have the bedrock runtime ID for our extended collision block, as well as its custom block state
// So then I think what we would prefer for the registry of the collision boxes is having the collision box be the key
// That registry will be used here to check if the given CustomBlockState is an extended collision block
// Then right here we can populate our final registry which maps the java runtime ID to the bedrock runtime ID of our collision block
// So therefore our initial extended collision registry should map to a set of java runtime IDs
} }
remappedVanillaIds = new int[vanillaBlockStates.size()]; remappedVanillaIds = new int[vanillaBlockStates.size()];

View file

@ -106,6 +106,7 @@ public class CustomBlockRegistryPopulator {
BoxComponent extendedCollisionBox = customBlockState.block().components().extendedCollisionBox(); BoxComponent extendedCollisionBox = customBlockState.block().components().extendedCollisionBox();
if (extendedCollisionBox != null) { if (extendedCollisionBox != null) {
extendedCollisionBoxes.put(id, extendedCollisionBox); extendedCollisionBoxes.put(id, extendedCollisionBox);
// Here and in the API, we will also need to add a method to build proper custom block data based on the extended collision box and add to customBlocks
} }
}); });
}); });