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

Properly fix hanging signs (#4872)

Dieser Commit ist enthalten in:
chris 2024-07-17 21:44:53 +02:00 committet von GitHub
Ursprung 406eae2a91
Commit 9fe3acc81c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
3 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -80,7 +80,6 @@ public class CreativeItemRegistryPopulator {
private static ItemData.@Nullable Builder createItemData(JsonNode itemNode, BlockMappings blockMappings, Map<String, ItemDefinition> definitions) {
int count = 1;
int damage = 0;
int bedrockBlockRuntimeId;
NbtMap tag = null;
String identifier = itemNode.get("id").textValue();

Datei anzeigen

@ -167,6 +167,7 @@ public class ItemRegistryPopulator {
Map<Item, ItemMapping> javaItemToMapping = new Object2ObjectOpenHashMap<>();
List<ItemData> creativeItems = new ArrayList<>();
Set<String> noBlockDefinitions = new ObjectOpenHashSet<>();
AtomicInteger creativeNetId = new AtomicInteger();
CreativeItemRegistryPopulator.populate(palette, definitions, itemBuilder -> {
@ -187,6 +188,9 @@ public class ItemRegistryPopulator {
bedrockBlockIdOverrides.put(identifier, item.getBlockDefinition());
}
}
} else {
// Item mappings should also NOT have a block definition for these.
noBlockDefinitions.add(item.getDefinition().getIdentifier());
}
});
@ -254,7 +258,12 @@ public class ItemRegistryPopulator {
} else {
// Try to get an example block runtime ID from the creative contents packet, for Bedrock identifier obtaining
int aValidBedrockBlockId = blacklistedIdentifiers.getOrDefault(bedrockIdentifier, customBlockItemOverride != null ? customBlockItemOverride.getRuntimeId() : -1);
if (aValidBedrockBlockId != -1 || customBlockItemOverride != null) {
if (aValidBedrockBlockId == -1 && customBlockItemOverride == null) {
// Fallback
if (!noBlockDefinitions.contains(entry.getValue().getBedrockIdentifier())) {
bedrockBlock = blockMappings.getBedrockBlock(firstBlockRuntimeId);
}
} else {
// As of 1.16.220, every item requires a block runtime ID attached to it.
// This is mostly for identifying different blocks with the same item ID - wool, slabs, some walls.
// However, in order for some visuals and crafting to work, we need to send the first matching block state

Datei anzeigen

@ -28,6 +28,7 @@ package org.geysermc.geyser.registry.type;
import it.unimi.dsi.fastutil.Pair;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.Value;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.cloudburstmc.protocol.bedrock.data.definitions.BlockDefinition;
@ -42,6 +43,7 @@ import java.util.List;
@Value
@Builder
@EqualsAndHashCode
@ToString
public class ItemMapping {
public static final ItemMapping AIR = new ItemMapping(
"minecraft:air",