3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-16 04:50:07 +01:00

Fix: Manually translated item names for block items not showing up properly (#4857)

Dieser Commit ist enthalten in:
chris 2024-07-13 22:00:15 +02:00 committet von GitHub
Ursprung b0c7ddb68d
Commit 6ab0186fc9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -59,6 +59,7 @@ import org.geysermc.geyser.inventory.item.StoredItemMappings;
import org.geysermc.geyser.item.GeyserCustomMappingData; import org.geysermc.geyser.item.GeyserCustomMappingData;
import org.geysermc.geyser.item.Items; import org.geysermc.geyser.item.Items;
import org.geysermc.geyser.item.components.Rarity; import org.geysermc.geyser.item.components.Rarity;
import org.geysermc.geyser.item.type.BlockItem;
import org.geysermc.geyser.item.type.Item; import org.geysermc.geyser.item.type.Item;
import org.geysermc.geyser.registry.BlockRegistries; import org.geysermc.geyser.registry.BlockRegistries;
import org.geysermc.geyser.registry.Registries; import org.geysermc.geyser.registry.Registries;
@ -403,7 +404,7 @@ public class ItemRegistryPopulator {
if (javaOnlyItems.contains(javaItem) || javaItem.rarity() != Rarity.COMMON) { if (javaOnlyItems.contains(javaItem) || javaItem.rarity() != Rarity.COMMON) {
// These items don't exist on Bedrock, so set up a variable that indicates they should have custom names // These items don't exist on Bedrock, so set up a variable that indicates they should have custom names
// Or, ensure that we are translating these at all times to account for rarity colouring // Or, ensure that we are translating these at all times to account for rarity colouring
mappingBuilder = mappingBuilder.translationString((bedrockBlock != null ? "block." : "item.") + entry.getKey().replace(":", ".")); mappingBuilder = mappingBuilder.translationString((javaItem instanceof BlockItem ? "block." : "item.") + entry.getKey().replace(":", "."));
GeyserImpl.getInstance().getLogger().debug("Adding " + entry.getKey() + " as an item that needs to be translated."); GeyserImpl.getInstance().getLogger().debug("Adding " + entry.getKey() + " as an item that needs to be translated.");
} }