Add support for new spawn eggs (#3688)

This commit is contained in:
onebeastchris 2023-05-02 21:09:07 +02:00 committed by GitHub
parent 5e5d5f3e43
commit f801dc05bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -74,9 +74,15 @@ public class ItemRegistryPopulator {
}
public static void populate() {
Map<Item, String> manualFallback = new HashMap<>();
manualFallback.put(Items.ENDER_DRAGON_SPAWN_EGG, "minecraft:enderman_spawn_egg");
manualFallback.put(Items.WITHER_SPAWN_EGG, "minecraft:wither_skeleton_spawn_egg");
manualFallback.put(Items.SNOW_GOLEM_SPAWN_EGG, "minecraft:polar_bear_spawn_egg");
manualFallback.put(Items.IRON_GOLEM_SPAWN_EGG, "minecraft:villager_spawn_egg");
Map<String, PaletteVersion> paletteVersions = new Object2ObjectOpenHashMap<>();
paletteVersions.put("1_19_20", new PaletteVersion(Bedrock_v544.CODEC.getProtocolVersion(), Collections.emptyMap()));
paletteVersions.put("1_19_50", new PaletteVersion(Bedrock_v560.CODEC.getProtocolVersion(), Collections.emptyMap()));
paletteVersions.put("1_19_20", new PaletteVersion(Bedrock_v544.CODEC.getProtocolVersion(), manualFallback));
paletteVersions.put("1_19_50", new PaletteVersion(Bedrock_v560.CODEC.getProtocolVersion(), manualFallback));
paletteVersions.put("1_19_60", new PaletteVersion(Bedrock_v567.CODEC.getProtocolVersion(), Collections.emptyMap()));
paletteVersions.put("1_19_70", new PaletteVersion(Bedrock_v575.CODEC.getProtocolVersion(), Collections.emptyMap()));
paletteVersions.put("1_19_80", new PaletteVersion(Bedrock_v582.CODEC.getProtocolVersion(), Collections.emptyMap()));
@ -176,6 +182,11 @@ public class ItemRegistryPopulator {
Set<Item> javaOnlyItems = new ObjectOpenHashSet<>();
Collections.addAll(javaOnlyItems, Items.SPECTRAL_ARROW, Items.DEBUG_STICK,
Items.KNOWLEDGE_BOOK, Items.TIPPED_ARROW, Items.BUNDLE);
// these spawn eggs exist in 1.19.60+;
if (palette.getValue().protocolVersion() < Bedrock_v567.CODEC.getProtocolVersion()) {
Collections.addAll(javaOnlyItems, Items.IRON_GOLEM_SPAWN_EGG, Items.SNOW_GOLEM_SPAWN_EGG,
Items.WITHER_SPAWN_EGG, Items.ENDER_DRAGON_SPAWN_EGG);
}
javaOnlyItems.add(Items.DECORATED_POT);
if (!customItemsAllowed) {
javaOnlyItems.add(Items.FURNACE_MINECART);

@ -1 +1 @@
Subproject commit 307a5fe26f39954974a316696147a3b4f1b97001
Subproject commit 56c3eee7a5241b5609d1936f2a11b05dd1a3d568