From 06db476f6004b4402e158723fbb537f06a4c254e Mon Sep 17 00:00:00 2001 From: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> Date: Tue, 7 Mar 2023 22:26:12 -0800 Subject: [PATCH] Add some notes for the extended collision box impl Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> --- .../geyser/registry/populator/BlockRegistryPopulator.java | 5 +++++ .../registry/populator/CustomBlockRegistryPopulator.java | 1 + 2 files changed, 6 insertions(+) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java index 3e3c577f6..11b633ebe 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java @@ -134,6 +134,11 @@ public final class BlockRegistryPopulator { NbtMap tag = customBlockStates.get(i); CustomBlockState blockState = customExtBlockStates.get(i); 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()]; diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/CustomBlockRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/CustomBlockRegistryPopulator.java index 330411fa9..abfbcdfc7 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/CustomBlockRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/CustomBlockRegistryPopulator.java @@ -106,6 +106,7 @@ public class CustomBlockRegistryPopulator { BoxComponent extendedCollisionBox = customBlockState.block().components().extendedCollisionBox(); if (extendedCollisionBox != null) { 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 } }); });