Use player scoreboard for determining collision rule when pushing entities#9127
Use player scoreboard for determining collision rule when pushing entities#9127Redned235 wants to merge 1 commit into
Conversation
|
collisions get weird, as especially player on player is pretty much 100% server sided, but, there is the wider caveat that this is a potential behavioral change for non player entities? I do wonder if something like this should be configurable |
I feel this would be more of a bug since in the event a vanilla scoreboard was used, the pushing behavior on the server would be properly in sync. Not entirely sure the ramifications of this, but if this could cause problems in certain situations I can add a config option. |
…ities The vanilla code in EntitySelector#pushable uses the Entity#getTeam method which returns the Level scoreboard. This means the wrong collision option is returned here when an API scoreboard is being used. Although no actual pushing occurs here as the client takes authority for that, the server still emits footstep sounds and treats it as if collision should be happening when it should not be.
6bfa071 to
ad9fe25
Compare
|
If we are overriding the getScoreBoard method, shouldn't we just modify the getTeam behavior to instead use .getScoreBoard() instead of |
I was thinking about doing this but noticed that other places like the /team command also would be affected by that. As of now none of the vanilla commands can interact with API scoreboards or teams and I thought going this route would be too big of a behavioral change. |
| + if (!this.isPushable()) { | ||
| + return; | ||
| + } | ||
| + net.minecraft.world.scores.Team team = this.getTeam(); |
There was a problem hiding this comment.
I'd probably argue that, if we are adding a new patch for this, this change should be in the added patch as well.
Fixing it in two places makes dropping a patch harder / knowing what the patch/fix entails.
Not too sure on it tho, I hope we can get some PRarathon started this weekend and I'll get back on this 👍
The vanilla code in EntitySelector#pushable uses the Entity#getTeam method which returns the Level scoreboard. This means the wrong collision option is returned here when an API scoreboard is being used. Although no actual pushing occurs here as the client takes authority for that, the server still emits footstep sounds and treats it as if collision should be happening when it should not be.
Demonstration of the issue (turn sound on):
2023-04-11.21-44-24.mp4