Open shenjackyuanjie opened 1 year ago
__on_player_command cannot be canceled
__on_player_command
At https://github.com/gnembon/fabric-carpet/commit/bf00051482883dd232bc4837418a2cbd3828f963#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0
The __on_player_message event was added At the moment, the event was uncancelable
__on_player_message
At https://github.com/gnembon/fabric-carpet/commit/24b9c386ec2a3527ba4e19c0fb2fbae9f522724c#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R302
Many event have ability to canceled
At https://github.com/gnembon/fabric-carpet/commit/43bb84437fc7c3214523c25b530e36aa3c85c014#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R313
The __on_player_command event was also added to make on_player_message event not triggered by player command but at the same time https://github.com/gnembon/fabric-carpet/commit/43bb84437fc7c3214523c25b530e36aa3c85c014#diff-8604ab23b322f862f9399fb1e6a685ea4900460b0202453c399f8221c09ba72c the docs was modified, the line 321 was been moved to line 324, with no changes witch tells people "the command event is cancelable, the message event is not"
on_player_message
but the truth is the command event mixin can't cancel https://github.com/gnembon/fabric-carpet/commit/43bb84437fc7c3214523c25b530e36aa3c85c014#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R313
So now the __on_player_command event can't cancel and the __on_player_message can
add a ci.cancel at https://github.com/gnembon/fabric-carpet/blob/43bb84437fc7c3214523c25b530e36aa3c85c014/src/main/java/carpet/mixins/ServerGamePacketListenerImpl_scarpetEventsMixin.java#L313
ci.cancel
change docs for these two event
I'm making a PR for it(
the problem
__on_player_command
cannot be canceledhow dose the issue cause
At https://github.com/gnembon/fabric-carpet/commit/bf00051482883dd232bc4837418a2cbd3828f963#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0
The
__on_player_message
event was added At the moment, the event was uncancelableAt https://github.com/gnembon/fabric-carpet/commit/24b9c386ec2a3527ba4e19c0fb2fbae9f522724c#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R302
Many event have ability to canceled
At https://github.com/gnembon/fabric-carpet/commit/43bb84437fc7c3214523c25b530e36aa3c85c014#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R313
The
__on_player_command
event was also added to makeon_player_message
event not triggered by player command but at the same time https://github.com/gnembon/fabric-carpet/commit/43bb84437fc7c3214523c25b530e36aa3c85c014#diff-8604ab23b322f862f9399fb1e6a685ea4900460b0202453c399f8221c09ba72c the docs was modified, the line 321 was been moved to line 324, with no changes witch tells people "the command event is cancelable, the message event is not"but the truth is the command event mixin can't cancel https://github.com/gnembon/fabric-carpet/commit/43bb84437fc7c3214523c25b530e36aa3c85c014#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R313
So now the
__on_player_command
event can't cancel and the__on_player_message
canhow to fix it
add a
ci.cancel
at https://github.com/gnembon/fabric-carpet/blob/43bb84437fc7c3214523c25b530e36aa3c85c014/src/main/java/carpet/mixins/ServerGamePacketListenerImpl_scarpetEventsMixin.java#L313change docs for these two event