Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client not updated after cancelling HandlePlace event. #749

Open
TacoError opened this issue Feb 12, 2023 · 0 comments · May be fixed by #882
Open

Client not updated after cancelling HandlePlace event. #749

TacoError opened this issue Feb 12, 2023 · 0 comments · May be fixed by #882
Labels
bug Something isn't working

Comments

@TacoError
Copy link

If the HandlePlace event is cancelled, and the item in the slot is set to air, the client still has the item in their inventory, but on server side it is still there.

Code:

func (i *InventoryHandler) HandlePlace(ctx *event.Context, slot int, it item.Stack) {
_, err := i.p.Inventory().Item(slot)
if err != nil {
return
}
ctx.Cancel()
fmt.Println("hello")
i.p.Inventory().SetItem(slot, item.Stack{})
}

Video example: https://streamable.com/x62xwv

@Sandertv Sandertv added the bug Something isn't working label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants