Skip to content

fix consumables, chargeables items#1140

Open
FDUTCH wants to merge 7 commits intodf-mc:masterfrom
FDUTCH:fix-usable-items
Open

fix consumables, chargeables items#1140
FDUTCH wants to merge 7 commits intodf-mc:masterfrom
FDUTCH:fix-usable-items

Conversation

@FDUTCH
Copy link
Copy Markdown
Contributor

@FDUTCH FDUTCH commented Dec 6, 2025

No description provided.

@FDUTCH
Copy link
Copy Markdown
Contributor Author

FDUTCH commented Dec 6, 2025

can anyone test this?

Comment thread server/player/player.go
if p.usingItem {
p.tryChargeItem(usable, false)
return
} else if time.Since(p.serverChargedItem) <= time.Millisecond*100 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way at all to distinguish the client wants to finish charging a crossbow vs. release it?

Comment thread server/player/player.go
p.handleUseContext(useCtx)
p.updateState()
if p.usingItem {
p.tryChargeItem(usable, false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there even a reason to care about the client finishing the charge anymore if we are handling it on player tick? I believe players get ticked before the transactions executed by packet handlers are handled, so player tick would beat UseItem in most cases unless the client sends too early, in which case the charge finish would be rejected anyway.

But if the UseItem charge attempt does not get rejected, would there not be an issue of crossbow releases sometimes having an artificial delay of 100ms and sometimes not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk if we should care about client finishing the charge, but I think it would be better to remove this option

I found that vanilla has a slight delay

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok we can see if any players end up complaining about that delay later then

Comment thread server/player/player.go Outdated
Comment thread server/player/player.go Outdated
@DaPigGuy DaPigGuy self-assigned this Dec 8, 2025
@shawtymarco
Copy link
Copy Markdown

can this get merged already i tested it out on 400+ms and worked perfectly fine

@shawtymarco
Copy link
Copy Markdown

this aged like fine wine xd

@DaPigGuy DaPigGuy removed their assignment Jan 4, 2026
@Sandertv
Copy link
Copy Markdown
Member

Sandertv commented Feb 5, 2026

@DaPigGuy what's your verdict? And have more people been able to test this to make sure it works properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants