From ea991e839ab15261ef36458838e92a26e15d096d Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 3 Sep 2024 16:34:26 +0200 Subject: [PATCH 01/13] potentially fix render bug regarding view distance --- .../main/java/org/geysermc/geyser/session/GeyserSession.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 607a58e0b88..9b2bc2184f5 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -716,7 +716,7 @@ public void connect() { upstream.sendPacket(componentPacket); } - ChunkUtils.sendEmptyChunks(this, playerEntity.getPosition().toInt(), 0, false); + ChunkUtils.sendEmptyChunks(this, playerEntity.getPosition().toInt(), 8, false); BiomeDefinitionListPacket biomeDefinitionListPacket = new BiomeDefinitionListPacket(); biomeDefinitionListPacket.setDefinitions(Registries.BIOMES_NBT.get()); From e3062a9190b93ba874cdcf371a94c3e34c11d789 Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 3 Sep 2024 17:17:52 +0200 Subject: [PATCH 02/13] potentially fix render bug regarding view distance --- core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java b/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java index f043631b67d..ce31e5b4efa 100644 --- a/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java @@ -175,7 +175,7 @@ private static void finalizeDimensionSwitch(GeyserSession session, Entity player // TODO - fix this hack of a fix by sending the final dimension switching logic after sections have been sent. // The client wants sections sent to it before it can successfully respawn. - ChunkUtils.sendEmptyChunks(session, player.getPosition().toInt(), 3, true); + ChunkUtils.sendEmptyChunks(session, player.getPosition().toInt(), 11, true); } public static void setBedrockDimension(GeyserSession session, int bedrockDimension) { From a8c485806b1ff8ebf88a63f3a0997e671204caa2 Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 3 Sep 2024 17:18:21 +0200 Subject: [PATCH 03/13] potentially fix render bug regarding view distance --- .../main/java/org/geysermc/geyser/session/GeyserSession.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 9b2bc2184f5..607a58e0b88 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -716,7 +716,7 @@ public void connect() { upstream.sendPacket(componentPacket); } - ChunkUtils.sendEmptyChunks(this, playerEntity.getPosition().toInt(), 8, false); + ChunkUtils.sendEmptyChunks(this, playerEntity.getPosition().toInt(), 0, false); BiomeDefinitionListPacket biomeDefinitionListPacket = new BiomeDefinitionListPacket(); biomeDefinitionListPacket.setDefinitions(Registries.BIOMES_NBT.get()); From eaa4c0354a20818eb9e9635f6694bfefbfaac505 Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 3 Sep 2024 17:41:17 +0200 Subject: [PATCH 04/13] add configuration option per environmental ("GEYSER_EMPTY_CHUNK_COUNT") --- .../main/java/org/geysermc/geyser/util/DimensionUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java b/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java index ce31e5b4efa..c880ab982b4 100644 --- a/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/DimensionUtils.java @@ -42,6 +42,7 @@ import org.geysermc.geyser.session.GeyserSession; import org.geysermc.mcprotocollib.protocol.data.game.entity.Effect; +import java.util.Optional; import java.util.Set; public class DimensionUtils { @@ -56,6 +57,7 @@ public class DimensionUtils { private static final int BEDROCK_OVERWORLD_ID = 0; private static final int BEDROCK_DEFAULT_NETHER_ID = 1; private static final int BEDROCK_END_ID = 2; + private static final int BEDROCK_EMPTY_CHUNK_COUNT = Optional.ofNullable(System.getenv("BEDROCK_EMPTY_CHUNK_COUNT")).map(Integer::parseInt).orElse(3); public static void switchDimension(GeyserSession session, JavaDimension javaDimension) { switchDimension(session, javaDimension, javaDimension.bedrockId()); @@ -175,7 +177,8 @@ private static void finalizeDimensionSwitch(GeyserSession session, Entity player // TODO - fix this hack of a fix by sending the final dimension switching logic after sections have been sent. // The client wants sections sent to it before it can successfully respawn. - ChunkUtils.sendEmptyChunks(session, player.getPosition().toInt(), 11, true); + + ChunkUtils.sendEmptyChunks(session, player.getPosition().toInt(), BEDROCK_EMPTY_CHUNK_COUNT, true); } public static void setBedrockDimension(GeyserSession session, int bedrockDimension) { From a4a383d687b4071d3a399544cbe1daaba4b78662 Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Thu, 19 Sep 2024 17:00:57 +0200 Subject: [PATCH 05/13] fix: purpur_pillars now also work in the inventory --- core/src/main/resources/mappings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/mappings b/core/src/main/resources/mappings index 830085e37e0..de537216805 160000 --- a/core/src/main/resources/mappings +++ b/core/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit 830085e37e0053c9d6116bcad37cafcba83aded5 +Subproject commit de5372168053a92fcd8411675e16e8fa9cdbd1e5 From d734458518d972ed9d201c46743de5095e8953cc Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 1 Oct 2024 09:04:39 +0200 Subject: [PATCH 06/13] chore: Update geyser to latest version --- core/src/main/resources/languages | 2 +- core/src/main/resources/mappings | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/languages b/core/src/main/resources/languages index 7499daf712a..61642604b8a 160000 --- a/core/src/main/resources/languages +++ b/core/src/main/resources/languages @@ -1 +1 @@ -Subproject commit 7499daf712ad6de70a07fba471b51b4ad92315c5 +Subproject commit 61642604b8af1673f714087837f0c4287bfdc492 diff --git a/core/src/main/resources/mappings b/core/src/main/resources/mappings index de537216805..d0405b947c5 160000 --- a/core/src/main/resources/mappings +++ b/core/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit de5372168053a92fcd8411675e16e8fa9cdbd1e5 +Subproject commit d0405b947c5ac593619eea07b3606247b2e08940 From 6c400013917547efa39340597c51eeadb686e25e Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 1 Oct 2024 09:30:02 +0200 Subject: [PATCH 07/13] fix: Path for mapppings --- core/src/main/resources/mappings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/mappings b/core/src/main/resources/mappings index d0405b947c5..93f207e7e9d 160000 --- a/core/src/main/resources/mappings +++ b/core/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit d0405b947c5ac593619eea07b3606247b2e08940 +Subproject commit 93f207e7e9d73f58a7c8902f7deda9dcb0524c8e From 200faee5fb61690628db54c56f3dd3977bca5fd3 Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Tue, 22 Oct 2024 19:42:34 +0200 Subject: [PATCH 08/13] fix: mappings for player_head --- .../registry/populator/Conversion748_729.java | 90 +++++++++++++++++++ .../populator/ItemRegistryPopulator.java | 2 +- core/src/main/resources/mappings | 2 +- 3 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java new file mode 100644 index 00000000000..a88b1f1b940 --- /dev/null +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2024 GeyserMC. http://geysermc.org + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC + * @link https://github.com/GeyserMC/Geyser + */ + +package org.geysermc.geyser.registry.populator; + +import org.geysermc.geyser.item.type.Item; +import org.geysermc.geyser.registry.type.GeyserMappingItem; + +import java.util.List; + +public class Conversion748_729 { + private static final List NEW_PLAYER_HEADS = List.of("minecraft:skeleton_skull", "minecraft:wither_skeleton_skull", "minecraft:zombie_head", "minecraft:player_head", "minecraft:creeper_head", "minecraft:dragon_head"); + + static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { + mapping = Conversion729_712.remapItem(item, mapping); + String identifier = mapping.getBedrockIdentifier(); + + if (NEW_PLAYER_HEADS.contains(identifier)) { + switch (identifier) { + case "minecraft:skeleton_skull" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(0) + .withFirstBlockRuntimeId(8827) + .withLastBlockRuntimeId(8858); + } + case "minecraft:wither_skeleton_skull" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(1) + .withFirstBlockRuntimeId(8867) + .withLastBlockRuntimeId(8898); + } + case "minecraft:zombie_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(2) + .withFirstBlockRuntimeId(8947) + .withLastBlockRuntimeId(8978); + } + case "minecraft:player_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(3) + .withFirstBlockRuntimeId(8907) + .withLastBlockRuntimeId(8938); + } + case "minecraft:creeper_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(4) + .withFirstBlockRuntimeId(8987) + .withLastBlockRuntimeId(9018); + } + case "minecraft:dragon_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(5) + .withFirstBlockRuntimeId(9027) + .withLastBlockRuntimeId(9058); + } + case "minecraft:piglin_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(6) + .withFirstBlockRuntimeId(9067) + .withLastBlockRuntimeId(9098); + } + } + } + + return mapping; + } + +} diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java index 12b5ebb0e3e..767c7d4124a 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java @@ -95,7 +95,7 @@ public static void populate() { paletteVersions.add(new PaletteVersion("1_20_80", Bedrock_v671.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion685_671::remapItem)); paletteVersions.add(new PaletteVersion("1_21_0", Bedrock_v685.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion712_685::remapItem)); paletteVersions.add(new PaletteVersion("1_21_20", Bedrock_v712.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion729_712::remapItem)); - paletteVersions.add(new PaletteVersion("1_21_30", Bedrock_v729.CODEC.getProtocolVersion())); + paletteVersions.add(new PaletteVersion("1_21_30", Bedrock_v729.CODEC.getProtocolVersion(), Collections.emptyMap(), Conversion748_729::remapItem)); paletteVersions.add(new PaletteVersion("1_21_40", Bedrock_v748.CODEC.getProtocolVersion())); GeyserBootstrap bootstrap = GeyserImpl.getInstance().getBootstrap(); diff --git a/core/src/main/resources/mappings b/core/src/main/resources/mappings index 93f207e7e9d..731de1750b4 160000 --- a/core/src/main/resources/mappings +++ b/core/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit 93f207e7e9d73f58a7c8902f7deda9dcb0524c8e +Subproject commit 731de1750b4307dfd836a246c262625188bcbe8e From a5205269e1dc63ffc09dd54349fce3ee9657053f Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Wed, 23 Oct 2024 11:35:10 +0200 Subject: [PATCH 09/13] fix: Mappings for skulls and heads --- .../registry/populator/Conversion685_671.java | 20 ++--- .../registry/populator/Conversion729_712.java | 1 + .../registry/populator/Conversion748_729.java | 81 ++++++++----------- .../populator/ItemRegistryPopulator.java | 1 + .../bedrock/runtime_item_states.1_21_40.json | 14 ++-- core/src/main/resources/mappings | 2 +- 6 files changed, 55 insertions(+), 64 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java index 0c7f540bf22..99354ca86c4 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java @@ -47,7 +47,7 @@ public class Conversion685_671 { static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { mapping = Conversion712_685.remapItem(item, mapping); - String identifer = mapping.getBedrockIdentifier(); + String identifier = mapping.getBedrockIdentifier(); if (NEW_MUSIC_DISCS.contains(item)) { return mapping.withBedrockIdentifier("minecraft:music_disc_otherside"); @@ -59,12 +59,12 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { return mapping.withBedrockIdentifier("minecraft:glass_bottle"); } - if (!NEW_BLOCKS.contains(identifer)) { + if (!NEW_BLOCKS.contains(identifier)) { return mapping; } - if (NEW_CORAL_BLOCKS.contains(identifer)) { - switch (identifer) { + if (NEW_CORAL_BLOCKS.contains(identifier)) { + switch (identifier) { case "minecraft:tube_coral_block" -> { return mapping.withBedrockIdentifier("minecraft:coral_block").withBedrockData(0); } case "minecraft:brain_coral_block" -> { return mapping.withBedrockIdentifier("minecraft:coral_block").withBedrockData(1); } case "minecraft:bubble_coral_block" -> { return mapping.withBedrockIdentifier("minecraft:coral_block").withBedrockData(2); } @@ -78,8 +78,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_DOUBLE_PLANTS.contains(identifer)) { - switch (identifer) { + if (NEW_DOUBLE_PLANTS.contains(identifier)) { + switch (identifier) { case "minecraft:sunflower" -> { return mapping.withBedrockIdentifier("minecraft:double_plant").withBedrockData(0); } case "minecraft:lilac" -> { return mapping.withBedrockIdentifier("minecraft:double_plant").withBedrockData(1); } case "minecraft:tall_grass" -> { return mapping.withBedrockIdentifier("minecraft:double_plant").withBedrockData(2); } @@ -89,8 +89,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_STONE_BLOCK_SLABS.contains(identifer)) { - switch (identifer) { + if (NEW_STONE_BLOCK_SLABS.contains(identifier)) { + switch (identifier) { case "minecraft:smooth_stone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab").withBedrockData(0); } case "minecraft:sandstone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab").withBedrockData(1); } case "minecraft:petrified_oak_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab").withBedrockData(2); } @@ -102,8 +102,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_TALLGRASSES.contains(identifer)) { - switch (identifer) { + if (NEW_TALLGRASSES.contains(identifier)) { + switch (identifier) { case "minecraft:short_grass" -> { return mapping.withBedrockIdentifier("minecraft:tallgrass").withBedrockData(1); } case "minecraft:fern" -> { return mapping.withBedrockIdentifier("minecraft:tallgrass").withBedrockData(2); } } diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion729_712.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion729_712.java index 5d4ebdc475f..fbc2233bc66 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion729_712.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion729_712.java @@ -16,6 +16,7 @@ public class Conversion729_712 { private static final List NEW_BLOCKS = Stream.of(NEW_PURPUR_BLOCKS, NEW_WALL_BLOCKS, NEW_SPONGE_BLOCKS, NEW_TNT_BLOCKS, STRUCTURE_VOID).flatMap(List::stream).toList(); static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { + mapping = Conversion748_729.remapItem(item, mapping); String identifier = mapping.getBedrockIdentifier(); if (!NEW_BLOCKS.contains(identifier)) { diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java index a88b1f1b940..f932f73c305 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java @@ -31,59 +31,44 @@ import java.util.List; public class Conversion748_729 { - private static final List NEW_PLAYER_HEADS = List.of("minecraft:skeleton_skull", "minecraft:wither_skeleton_skull", "minecraft:zombie_head", "minecraft:player_head", "minecraft:creeper_head", "minecraft:dragon_head"); + + private static final List NEW_PLAYER_HEADS = List.of("minecraft:skeleton_skull", "minecraft:wither_skeleton_skull", "minecraft:zombie_head", "minecraft:player_head", "minecraft:creeper_head", "minecraft:dragon_head", "minecraft:piglin_head"); static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { - mapping = Conversion729_712.remapItem(item, mapping); String identifier = mapping.getBedrockIdentifier(); - - if (NEW_PLAYER_HEADS.contains(identifier)) { - switch (identifier) { - case "minecraft:skeleton_skull" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(0) - .withFirstBlockRuntimeId(8827) - .withLastBlockRuntimeId(8858); - } - case "minecraft:wither_skeleton_skull" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(1) - .withFirstBlockRuntimeId(8867) - .withLastBlockRuntimeId(8898); - } - case "minecraft:zombie_head" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(2) - .withFirstBlockRuntimeId(8947) - .withLastBlockRuntimeId(8978); - } - case "minecraft:player_head" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(3) - .withFirstBlockRuntimeId(8907) - .withLastBlockRuntimeId(8938); - } - case "minecraft:creeper_head" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(4) - .withFirstBlockRuntimeId(8987) - .withLastBlockRuntimeId(9018); - } - case "minecraft:dragon_head" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(5) - .withFirstBlockRuntimeId(9027) - .withLastBlockRuntimeId(9058); - } - case "minecraft:piglin_head" -> { - return mapping.withBedrockIdentifier("minecraft:skull") - .withBedrockData(6) - .withFirstBlockRuntimeId(9067) - .withLastBlockRuntimeId(9098); - } + if (!NEW_PLAYER_HEADS.contains(identifier)) { + return mapping; + } + switch (identifier) { + case "minecraft:skeleton_skull" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(0); + } + case "minecraft:wither_skeleton_skull" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(1); + } + case "minecraft:zombie_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(2); + } + case "minecraft:player_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(3); + } + case "minecraft:creeper_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(4); + } + case "minecraft:dragon_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(5); + } + case "minecraft:piglin_head" -> { + return mapping.withBedrockIdentifier("minecraft:skull") + .withBedrockData(6); } } - return mapping; } diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java index 767c7d4124a..3f550d9c3a5 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/ItemRegistryPopulator.java @@ -71,6 +71,7 @@ import java.io.InputStream; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.Logger; /** * Populates the item registries. diff --git a/core/src/main/resources/bedrock/runtime_item_states.1_21_40.json b/core/src/main/resources/bedrock/runtime_item_states.1_21_40.json index 9ad93dd096b..9c6326868bb 100644 --- a/core/src/main/resources/bedrock/runtime_item_states.1_21_40.json +++ b/core/src/main/resources/bedrock/runtime_item_states.1_21_40.json @@ -3547,6 +3547,10 @@ "name": "minecraft:item.reeds", "id": 83 }, + { + "name": "minecraft:item.skull", + "id": 144 + }, { "name": "minecraft:item.soul_campfire", "id": -290 @@ -5664,12 +5668,12 @@ "id": 144 }, { - "name": "minecraft:skeleton_spawn_egg", - "id": 471 + "name": "minecraft:skull", + "id": 533 }, { - "name": "minecraft:skull", - "id": 736 + "name": "minecraft:skeleton_spawn_egg", + "id": 471 }, { "name": "minecraft:skull_banner_pattern", @@ -6991,4 +6995,4 @@ "name": "minecraft:zombie_villager_spawn_egg", "id": 505 } -] \ No newline at end of file +] diff --git a/core/src/main/resources/mappings b/core/src/main/resources/mappings index 731de1750b4..d0fb96308d2 160000 --- a/core/src/main/resources/mappings +++ b/core/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit 731de1750b4307dfd836a246c262625188bcbe8e +Subproject commit d0fb96308d273b45c93608cdba19d47413e3e664 From 6d41fc58f8d3bbff3db8bd0687ba48546a0934e4 Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Wed, 23 Oct 2024 13:39:45 +0200 Subject: [PATCH 10/13] fix: typos in identifier --- .../registry/populator/Conversion685_671.java | 1 - .../registry/populator/Conversion712_685.java | 51 +++++++++---------- .../registry/populator/Conversion748_729.java | 1 + 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java index 99354ca86c4..c72ea64b207 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion685_671.java @@ -46,7 +46,6 @@ public class Conversion685_671 { static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { mapping = Conversion712_685.remapItem(item, mapping); - String identifier = mapping.getBedrockIdentifier(); if (NEW_MUSIC_DISCS.contains(item)) { diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion712_685.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion712_685.java index db715e01580..45963cb9095 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion712_685.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion712_685.java @@ -33,35 +33,34 @@ public class Conversion712_685 { static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { mapping = Conversion729_712.remapItem(item, mapping); + String identifier = mapping.getBedrockIdentifier(); - String identifer = mapping.getBedrockIdentifier(); - - if (!NEW_BLOCKS.contains(identifer)) { + if (!NEW_BLOCKS.contains(identifier)) { return mapping; } - if (identifer.equals("minecraft:coarse_dirt")) { + if (identifier.equals("minecraft:coarse_dirt")) { return mapping.withBedrockIdentifier("minecraft:dirt").withBedrockData(1); } - if (identifer.equals("minecraft:dandelion")) { + if (identifier.equals("minecraft:dandelion")) { return mapping.withBedrockIdentifier("minecraft:yellow_flower").withBedrockData(0); } - if (identifer.equals("minecraft:red_sand")) { + if (identifier.equals("minecraft:red_sand")) { return mapping.withBedrockIdentifier("minecraft:sand").withBedrockData(1); } - if (NEW_PRISMARINE_BLOCKS.contains(identifer)) { - switch (identifer) { + if (NEW_PRISMARINE_BLOCKS.contains(identifier)) { + switch (identifier) { case "minecraft:prismarine" -> { return mapping.withBedrockIdentifier("minecraft:prismarine").withBedrockData(0); } case "minecraft:dark_prismarine" -> { return mapping.withBedrockIdentifier("minecraft:prismarine").withBedrockData(1); } case "minecraft:prismarine_bricks" -> { return mapping.withBedrockIdentifier("minecraft:prismarine").withBedrockData(2); } } } - if (NEW_SANDSTONE_BLOCKS.contains(identifer)) { - switch (identifer) { + if (NEW_SANDSTONE_BLOCKS.contains(identifier)) { + switch (identifier) { case "minecraft:sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(0); } case "minecraft:chiseled_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(1); } case "minecraft:cut_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:sandstone").withBedrockData(2); } @@ -69,8 +68,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_RED_SANDSTONE_BLOCKS.contains(identifer)) { - switch (identifer) { + if (NEW_RED_SANDSTONE_BLOCKS.contains(identifier)) { + switch (identifier) { case "minecraft:red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(0); } case "minecraft:chiseled_red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(1); } case "minecraft:cut_red_sandstone" -> { return mapping.withBedrockIdentifier("minecraft:red_sandstone").withBedrockData(2); } @@ -78,8 +77,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_QUARTZ_BLOCKS.contains(identifer)) { - switch (identifer) { + if (NEW_QUARTZ_BLOCKS.contains(identifier)) { + switch (identifier) { case "minecraft:quartz_block" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(0); } case "minecraft:chiseled_quartz_block" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(1); } case "minecraft:quartz_pillar" -> { return mapping.withBedrockIdentifier("minecraft:quartz_block").withBedrockData(2); } @@ -87,8 +86,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_STONE_BLOCK_SLABS_2.contains(identifer)) { - switch (identifer) { + if (NEW_STONE_BLOCK_SLABS_2.contains(identifier)) { + switch (identifier) { case "minecraft:red_sandstone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab2").withBedrockData(0); } case "minecraft:purpur_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab2").withBedrockData(1); } case "minecraft:prismarine_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab2").withBedrockData(2); } @@ -100,8 +99,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_STONE_BLOCK_SLABS_3.contains(identifer)) { - switch (identifer) { + if (NEW_STONE_BLOCK_SLABS_3.contains(identifier)) { + switch (identifier) { case "minecraft:end_stone_brick_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab3").withBedrockData(0); } case "minecraft:smooth_red_sandstone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab3").withBedrockData(1); } case "minecraft:polished_andesite_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab3").withBedrockData(2); } @@ -113,8 +112,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_STONE_BLOCK_SLABS_4.contains(identifer)) { - switch (identifer) { + if (NEW_STONE_BLOCK_SLABS_4.contains(identifier)) { + switch (identifier) { case "minecraft:mossy_stone_brick_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab4").withBedrockData(0); } case "minecraft:smooth_quartz_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab4").withBedrockData(1); } case "minecraft:normal_stone_slab" -> { return mapping.withBedrockIdentifier("minecraft:stone_block_slab4").withBedrockData(2); } @@ -123,8 +122,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_MONSTER_EGGS.contains(identifer)) { - switch (identifer) { + if (NEW_MONSTER_EGGS.contains(identifier)) { + switch (identifier) { case "minecraft:infested_stone" -> { return mapping.withBedrockIdentifier("minecraft:monster_egg").withBedrockData(0); } case "minecraft:infested_cobblestone" -> { return mapping.withBedrockIdentifier("minecraft:monster_egg").withBedrockData(1); } case "minecraft:infested_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:monster_egg").withBedrockData(2); } @@ -134,8 +133,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_STONEBRICK_BLOCKS.contains(identifer)) { - switch (identifer) { + if (NEW_STONEBRICK_BLOCKS.contains(identifier)) { + switch (identifier) { case "minecraft:stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(0); } case "minecraft:mossy_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(1); } case "minecraft:cracked_stone_bricks" -> { return mapping.withBedrockIdentifier("minecraft:stonebrick").withBedrockData(2); } @@ -143,8 +142,8 @@ static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { } } - if (NEW_ANVILS.contains(identifer)) { - switch (identifer) { + if (NEW_ANVILS.contains(identifier)) { + switch (identifier) { case "minecraft:anvil" -> { return mapping.withBedrockIdentifier("minecraft:anvil").withBedrockData(0); } case "minecraft:chipped_anvil" -> { return mapping.withBedrockIdentifier("minecraft:anvil").withBedrockData(4); } case "minecraft:damaged_anvil" -> { return mapping.withBedrockIdentifier("minecraft:anvil").withBedrockData(8); } diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java index f932f73c305..0c5ce7d70c2 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/Conversion748_729.java @@ -36,6 +36,7 @@ public class Conversion748_729 { static GeyserMappingItem remapItem(Item item, GeyserMappingItem mapping) { String identifier = mapping.getBedrockIdentifier(); + if (!NEW_PLAYER_HEADS.contains(identifier)) { return mapping; } From cc4e871ee80ca750ad34a0b7142a080737f57abb Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Wed, 23 Oct 2024 13:45:13 +0200 Subject: [PATCH 11/13] fix: mappings --- .gitmodules | 6 +++--- core/src/main/resources/mappings | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1fdd0334319..731aad3a808 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "core/src/main/resources/mappings"] - path = core/src/main/resources/mappings - url = https://github.com/GeyserMC/mappings.git [submodule "core/src/main/resources/languages"] path = core/src/main/resources/languages url = https://github.com/GeyserMC/languages.git +[submodule "core/src/main/resources/mappings"] + path = core/src/main/resources/mappings + url = https://github.com/GeyserMC/mappings.git diff --git a/core/src/main/resources/mappings b/core/src/main/resources/mappings index d0fb96308d2..4a9676697f7 160000 --- a/core/src/main/resources/mappings +++ b/core/src/main/resources/mappings @@ -1 +1 @@ -Subproject commit d0fb96308d273b45c93608cdba19d47413e3e664 +Subproject commit 4a9676697f7d23924aac82706b33e2a7b05588a1 From 0a777a4d5202ae02354c43033beaf5926ececcbb Mon Sep 17 00:00:00 2001 From: Tjorven-Liebe Date: Wed, 23 Oct 2024 13:48:08 +0200 Subject: [PATCH 12/13] fix: link in .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 731aad3a808..2cc8b16add1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/GeyserMC/languages.git [submodule "core/src/main/resources/mappings"] path = core/src/main/resources/mappings - url = https://github.com/GeyserMC/mappings.git + url = https://github.com/iwmedia/geyser-mappings.git From c9df9b127835810a0724eb77d37b98d04edf9f78 Mon Sep 17 00:00:00 2001 From: Tjorven Liebe <32434395+Tjorven-Liebe@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:27:46 +0100 Subject: [PATCH 13/13] Update .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 2cc8b16add1..731aad3a808 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/GeyserMC/languages.git [submodule "core/src/main/resources/mappings"] path = core/src/main/resources/mappings - url = https://github.com/iwmedia/geyser-mappings.git + url = https://github.com/GeyserMC/mappings.git