3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01:00

Recipes are fixed in 1.19.80

Dieser Commit ist enthalten in:
Camotoy 2023-04-23 14:09:51 -04:00
Ursprung 2ac7eb83c0
Commit 365dd622bb
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F
2 geänderte Dateien mit 12 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -81,6 +81,14 @@ public class CreativeItemRegistryPopulator {
int damage = 0; int damage = 0;
int bedrockBlockRuntimeId = -1; int bedrockBlockRuntimeId = -1;
NbtMap tag = null; NbtMap tag = null;
String identifier = itemNode.get("id").textValue();
for (BiPredicate<String, Integer> predicate : JAVA_ONLY_ITEM_FILTER) {
if (predicate.test(identifier, damage)) {
return null;
}
}
JsonNode damageNode = itemNode.get("damage"); JsonNode damageNode = itemNode.get("damage");
if (damageNode != null) { if (damageNode != null) {
damage = damageNode.asInt(); damage = damageNode.asInt();
@ -94,6 +102,9 @@ public class CreativeItemRegistryPopulator {
JsonNode blockRuntimeIdNode = itemNode.get("blockRuntimeId"); JsonNode blockRuntimeIdNode = itemNode.get("blockRuntimeId");
if (blockRuntimeIdNode != null) { if (blockRuntimeIdNode != null) {
bedrockBlockRuntimeId = blockRuntimeIdNode.asInt(); bedrockBlockRuntimeId = blockRuntimeIdNode.asInt();
if (bedrockBlockRuntimeId == 0 && !identifier.equals("minecraft:blue_candle")) { // FIXME
bedrockBlockRuntimeId = -1;
}
} }
JsonNode nbtNode = itemNode.get("nbt_b64"); JsonNode nbtNode = itemNode.get("nbt_b64");
@ -107,13 +118,6 @@ public class CreativeItemRegistryPopulator {
} }
} }
String identifier = itemNode.get("id").textValue();
for (BiPredicate<String, Integer> predicate : JAVA_ONLY_ITEM_FILTER) {
if (predicate.test(identifier, damage)) {
return null;
}
}
ItemDefinition definition = definitions.get(identifier); ItemDefinition definition = definitions.get(identifier);
if (definition == null) { if (definition == null) {
GeyserImpl.getInstance().getLogger().debug("Unknown item definition with identifier " + identifier + " when loading creative items!"); GeyserImpl.getInstance().getLogger().debug("Unknown item definition with identifier " + identifier + " when loading creative items!");

Datei anzeigen

@ -158,7 +158,7 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator<ClientboundUpd
if (GameProtocol.supports1_19_60(session)) { if (GameProtocol.supports1_19_60(session)) {
// Note: vanilla inputs use aux value of Short.MAX_VALUE // Note: vanilla inputs use aux value of Short.MAX_VALUE
craftingDataPacket.getCraftingData().add(SmithingTransformRecipeData.of(recipe.getIdentifier(), craftingDataPacket.getCraftingData().add(SmithingTransformRecipeData.of(recipe.getIdentifier(),
bedrockBase, bedrockAddition, output, "smithing_table", netId++)); ItemDescriptorWithCount.EMPTY, bedrockBase, bedrockAddition, output, "smithing_table", netId++));
} else { } else {
UUID uuid = UUID.randomUUID(); UUID uuid = UUID.randomUUID();
craftingDataPacket.getCraftingData().add(org.cloudburstmc.protocol.bedrock.data.inventory.crafting.recipe.ShapelessRecipeData.shapeless(uuid.toString(), craftingDataPacket.getCraftingData().add(org.cloudburstmc.protocol.bedrock.data.inventory.crafting.recipe.ShapelessRecipeData.shapeless(uuid.toString(),