This commit is contained in:
Matthew 2024-03-13 11:18:47 +01:00 committed by GitHub
parent a9467cf150
commit d29f355ef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 6 deletions

View File

@ -134,13 +134,15 @@ public class JavaUpdateRecipesTranslator extends PacketTranslator<ClientboundUpd
List<String> bedrockRecipeIDs = new ArrayList<>();
for (ItemDescriptorWithCount[] inputs : inputCombinations) {
UUID uuid = UUID.randomUUID();
bedrockRecipeIDs.add(uuid.toString());
craftingDataPacket.getCraftingData().add(org.cloudburstmc.protocol.bedrock.data.inventory.crafting.recipe.ShapelessRecipeData.shapeless(uuid.toString(),
Arrays.asList(inputs), Collections.singletonList(output), uuid, "crafting_table", 0, netId));
recipeMap.put(netId++, new GeyserShapelessRecipe(shapelessRecipeData));
if (Arrays.stream(inputs).noneMatch(it -> (it.getDescriptor() instanceof InvalidDescriptor))) {
UUID uuid = UUID.randomUUID();
bedrockRecipeIDs.add(uuid.toString());
craftingDataPacket.getCraftingData().add(org.cloudburstmc.protocol.bedrock.data.inventory.crafting.recipe.ShapelessRecipeData.shapeless(uuid.toString(),
Arrays.asList(inputs), Collections.singletonList(output), uuid, "crafting_table", 0, netId));
recipeMap.put(netId++, new GeyserShapelessRecipe(shapelessRecipeData));
addRecipeIdentifier(session, recipe.getIdentifier(), bedrockRecipeIDs);
}
}
addRecipeIdentifier(session, recipe.getIdentifier(), bedrockRecipeIDs);
}
case CRAFTING_SHAPED -> {
ShapedRecipeData shapedRecipeData = (ShapedRecipeData) recipe.getData();