1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Version item components, update creative items

This commit is contained in:
onebeastchris
2025-10-24 17:00:57 +02:00
parent 673255751c
commit 7a6367d855
8 changed files with 20854 additions and 8 deletions

View File

@@ -197,7 +197,7 @@ public class ItemRegistryPopulator {
paletteVersions.add(new PaletteVersion("1_21_93", Bedrock_v819.CODEC.getProtocolVersion(), eightOneNineFallbacks, Conversion844_827::remapItem));
paletteVersions.add(new PaletteVersion("1_21_100", Bedrock_v827.CODEC.getProtocolVersion(), eightTwoSevenFallbacks, Conversion844_827::remapItem));
paletteVersions.add(new PaletteVersion("1_21_110", Bedrock_v844.CODEC.getProtocolVersion()));
paletteVersions.add(new PaletteVersion("1_21_110", Bedrock_v859.CODEC.getProtocolVersion()));
paletteVersions.add(new PaletteVersion("1_21_120", Bedrock_v859.CODEC.getProtocolVersion()));
GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap();
@@ -211,13 +211,6 @@ public class ItemRegistryPopulator {
throw new AssertionError("Unable to load Java runtime item IDs", e);
}
NbtMap vanillaComponents;
try (InputStream stream = bootstrap.getResourceOrThrow("bedrock/item_components.nbt")) {
vanillaComponents = (NbtMap) NbtUtils.createGZIPReader(stream, true, true).readTag();
} catch (Exception e) {
throw new AssertionError("Unable to load Bedrock item components", e);
}
boolean customItemsAllowed = GeyserImpl.getInstance().getConfig().isAddNonBedrockItems();
// List values here is important compared to HashSet - we need to preserve the order of what's given to us
@@ -244,6 +237,13 @@ public class ItemRegistryPopulator {
throw new AssertionError("Unable to load Bedrock runtime item IDs", e);
}
NbtMap vanillaComponents;
try (InputStream stream = bootstrap.getResourceOrThrow("bedrock/item_components.%s.nbt".formatted(palette.version()))) {
vanillaComponents = (NbtMap) NbtUtils.createGZIPReader(stream, true, true).readTag();
} catch (Exception e) {
throw new AssertionError("Unable to load Bedrock item components", e);
}
// Used for custom items
int nextFreeBedrockId = 0;
Int2ObjectMap<ItemDefinition> registry = new Int2ObjectOpenHashMap<>();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff