-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minecraft/protocol: Update to support 1.20.50
- Loading branch information
1 parent
2b48a19
commit 14c3da7
Showing
13 changed files
with
140 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
minecraft/protocol/packet/player_toggle_crafter_slot_request.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package packet | ||
|
||
import ( | ||
"github.com/sandertv/gophertunnel/minecraft/protocol" | ||
) | ||
|
||
// PlayerToggleCrafterSlotRequest is sent by the client when it tries to toggle the state of a slot within a Crafter. | ||
type PlayerToggleCrafterSlotRequest struct { | ||
// PosX is the X position of the Crafter that is being modified. | ||
PosX int32 | ||
// PosY is the Y position of the Crafter that is being modified. | ||
PosY int32 | ||
// PosZ is the Z position of the Crafter that is being modified. | ||
PosZ int32 | ||
// Slot is the index of the slot that was toggled. This should be a value between 0 and 8. | ||
Slot byte | ||
// Disabled is the new state of the slot. If true, the slot is disabled, if false, the slot is enabled. | ||
Disabled bool | ||
} | ||
|
||
// ID ... | ||
func (*PlayerToggleCrafterSlotRequest) ID() uint32 { | ||
return IDPlayerToggleCrafterSlotRequest | ||
} | ||
|
||
func (pk *PlayerToggleCrafterSlotRequest) Marshal(io protocol.IO) { | ||
io.Int32(&pk.PosX) | ||
io.Int32(&pk.PosY) | ||
io.Int32(&pk.PosZ) | ||
io.Uint8(&pk.Slot) | ||
io.Bool(&pk.Disabled) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package packet | ||
|
||
import ( | ||
"github.com/sandertv/gophertunnel/minecraft/protocol" | ||
) | ||
|
||
const ( | ||
InventoryLayoutNone = iota | ||
InventoryLayoutSurvival | ||
InventoryLayoutRecipeBook | ||
InventoryLayoutCreative | ||
) | ||
|
||
const ( | ||
InventoryLeftTabNone = iota | ||
InventoryLeftTabConstruction | ||
InventoryLeftTabEquipment | ||
InventoryLeftTabItems | ||
InventoryLeftTabNature | ||
InventoryLeftTabSearch | ||
InventoryLeftTabSurvival | ||
) | ||
|
||
const ( | ||
InventoryRightTabNone = iota | ||
InventoryRightTabFullScreen | ||
InventoryRightTabCrafting | ||
InventoryRightTabArmour | ||
) | ||
|
||
// SetPlayerInventoryOptions is sent by the client when it tries to toggle the state of a slot within a Crafter. | ||
type SetPlayerInventoryOptions struct { | ||
// LeftInventoryTab is the tab that is selected on the left side of the inventory. This is usually for the creative | ||
// inventory. It is one of the constants above. | ||
LeftInventoryTab byte | ||
// RightInventoryTab is the tab that is selected on the right side of the inventory. This is usually for the player's | ||
// own inventory. It is one of the constants above. | ||
RightInventoryTab byte | ||
// Filtering is whether the player has enabled the filtering between recipes they have unlocked or not. | ||
Filtering bool | ||
// InventoryLayout is the layout of the inventory. It is one of the constants above. | ||
InventoryLayout byte | ||
// CraftingLayout is the layout of the crafting inventory. It is one of the constants above. | ||
CraftingLayout byte | ||
} | ||
|
||
// ID ... | ||
func (*SetPlayerInventoryOptions) ID() uint32 { | ||
return IDSetPlayerInventoryOptions | ||
} | ||
|
||
func (pk *SetPlayerInventoryOptions) Marshal(io protocol.IO) { | ||
io.Uint8(&pk.LeftInventoryTab) | ||
io.Uint8(&pk.RightInventoryTab) | ||
io.Bool(&pk.Filtering) | ||
io.Uint8(&pk.InventoryLayout) | ||
io.Uint8(&pk.CraftingLayout) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters