mirror of https://github.com/GeyserMC/Geyser.git
More efficent order
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
parent
9f1f7bf4f0
commit
b712a0cd6b
|
@ -46,21 +46,21 @@ public class JavaClientboundRecipesTranslator extends PacketTranslator<Clientbou
|
|||
recipesPacket.getUnlockedRecipes().addAll(getBedrockRecipes(session, packet.getAlreadyKnownRecipes()));
|
||||
}
|
||||
case ADD -> {
|
||||
recipesPacket.setAction(UnlockedRecipesPacket.ActionType.NEWLY_UNLOCKED);
|
||||
List<String> recipes = getBedrockRecipes(session, packet.getRecipes());
|
||||
if (recipes.isEmpty()) {
|
||||
// Sending an empty list here packet will crash the client as of 1.20.60
|
||||
return;
|
||||
}
|
||||
recipesPacket.setAction(UnlockedRecipesPacket.ActionType.NEWLY_UNLOCKED);
|
||||
recipesPacket.getUnlockedRecipes().addAll(recipes);
|
||||
}
|
||||
case REMOVE -> {
|
||||
recipesPacket.setAction(UnlockedRecipesPacket.ActionType.REMOVE_UNLOCKED);
|
||||
List<String> recipes = getBedrockRecipes(session, packet.getRecipes());
|
||||
if (recipes.isEmpty()) {
|
||||
// Sending an empty list here will crash the client as of 1.20.60
|
||||
return;
|
||||
}
|
||||
recipesPacket.setAction(UnlockedRecipesPacket.ActionType.REMOVE_UNLOCKED);
|
||||
recipesPacket.getUnlockedRecipes().addAll(getBedrockRecipes(session, packet.getRecipes()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue