mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
feat: send all crafting recipes to players (#1999)
* feat: send all recipes to players * chore: clippy and added config option
This commit is contained in:
@@ -9,10 +9,11 @@ use pumpkin_protocol::java::server::play::{
|
||||
SAttack, SChangeGameMode, SChatCommand, SChatMessage, SChunkBatch, SClickSlot, SClientCommand,
|
||||
SClientInformationPlay, SClientTickEnd, SCloseContainer, SCommandSuggestion, SConfirmTeleport,
|
||||
SCookieResponse as SPCookieResponse, SCustomPayload, SInteract, SKeepAlive, SMoveVehicle,
|
||||
SPaddleBoat, SPickItemFromBlock, SPlayPingRequest, SPlayerAbilities, SPlayerAction,
|
||||
SPlayerCommand, SPlayerInput, SPlayerLoaded, SPlayerPosition, SPlayerPositionRotation,
|
||||
SPlayerRotation, SPlayerSession, SSetCommandBlock, SSetCreativeSlot, SSetHeldItem,
|
||||
SSetPlayerGround, SSwingArm, SUpdateSign, SUseItem, SUseItemOn,
|
||||
SPaddleBoat, SPickItemFromBlock, SPlaceRecipe, SPlayPingRequest, SPlayerAbilities,
|
||||
SPlayerAction, SPlayerCommand, SPlayerInput, SPlayerLoaded, SPlayerPosition,
|
||||
SPlayerPositionRotation, SPlayerRotation, SPlayerSession, SRecipeBookChangeSettings,
|
||||
SRecipeBookSeenRecipe, SSetCommandBlock, SSetCreativeSlot, SSetHeldItem, SSetPlayerGround,
|
||||
SSwingArm, SUpdateSign, SUseItem, SUseItemOn,
|
||||
};
|
||||
use pumpkin_protocol::packet::MultiVersionJavaPacket;
|
||||
use pumpkin_protocol::{
|
||||
@@ -856,6 +857,24 @@ impl JavaClient {
|
||||
);
|
||||
server.plugin_manager.fire(event).await;
|
||||
}
|
||||
id if id == SRecipeBookChangeSettings::to_id(version) => {
|
||||
self.handle_recipe_book_change_settings(
|
||||
player,
|
||||
SRecipeBookChangeSettings::read(payload, &version)?,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
id if id == SRecipeBookSeenRecipe::to_id(version) => {
|
||||
self.handle_recipe_book_seen_recipe(
|
||||
player,
|
||||
SRecipeBookSeenRecipe::read(payload, &version)?,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
id if id == SPlaceRecipe::to_id(version) => {
|
||||
self.handle_place_recipe(player, SPlaceRecipe::read(payload, &version)?)
|
||||
.await;
|
||||
}
|
||||
_ => {
|
||||
warn!("Failed to handle player packet id {}", packet.id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user