Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Fix option fixClimbingBypassCramming

Open HaHaWTH opened this issue 6 months ago • 10 comments

This pull request fixes config option fixClimbingBypassingCrammingRule not working on Paper 1.21.7, the config value is never getting passed.

I directly edited the Level#getPushableEntities as the only usage is the one in LivingEntity#pushEntities.

HaHaWTH avatar Jul 03 '25 15:07 HaHaWTH

It's passed here to LivingEntity#isPushable which as far as I can tell should be enough. Are you saying that how cramming itself works changed so that this isPushable check isn't responsible for the cramming damage anymore?

Phoenix616 avatar Jul 03 '25 15:07 Phoenix616

It's passed here to LivingEntity#isPushable which as far as I can tell should be enough. Are you saying that how cramming itself works changed so that this isPushable check isn't responsible for the cramming damage anymore?

The getPushableEntities is using EntitySelector.pushableBy, which is always passing a false to isCollidable IMG

The isPushable check at head passed but getting entities ignored this, so the result entity list won't include climbing entities even fixClimbingBypassingCrammingRule is true

HaHaWTH avatar Jul 03 '25 16:07 HaHaWTH

Right, looks like there is an unnecessary change there in the pushableBy method:

There should be no reason to even have a pushableBy(Entity, boolean) method with the ignoreClimbing parameter (as it is never set to anything but false) and it should work when simply using the same code as before the patch (at least for the push-check) which used isPushable (which then uses the config option) instead of the custom isCollidable which takes the parameter.

I personally think that's the cleaner approach as it actually reduces the diff instead of increasing it as your solution does.

Phoenix616 avatar Jul 03 '25 16:07 Phoenix616

Right, looks like there is an unnecessary change there in the pushableBy method:

There should be no reason to even have a pushableBy(Entity, boolean) method with the ignoreClimbing parameter (as it is never set to anything but false) and it should work when simply using the same code as before the patch (at least for the push-check) which used isPushable (which then uses the config option) instead of the custom isCollidable which takes the parameter.

I personally think that's the cleaner approach as it actually reduces the diff instead of increasing it as your solution does.

Yeah but, vanilla uses pushableBy entity selector, the pushable added by Paper is a redirection, which prevents diffs from flying everywhere. And some entities don't need this check like boats and minecarts. (see AbstractBoat and Old/NewMinecartBehavior)

HaHaWTH avatar Jul 03 '25 16:07 HaHaWTH

I'm unsure what you mean by "prevents diffs from flying everywhere" seeing as you are increasing the diff which would be my understanding of "flying everyhwere".

Also Boats and Minecarts are not a LivingEntity hence why the climbing setting wouldn't even apply to them (it's defined in LivingEntity#isPushable after all)

Phoenix616 avatar Jul 03 '25 16:07 Phoenix616

Just to be a bit more clear, this is what I suggest (I haven't tested that though) image

Phoenix616 avatar Jul 03 '25 16:07 Phoenix616

Yea that would make sense, i assume that should be included in another PR? Seems kinda off-topic for this one though( ´▽` )

HaHaWTH avatar Jul 03 '25 16:07 HaHaWTH

Yea that would make sense, i assume that should be included in another PR? Seems kinda off-topic for this one though( ´▽` )

What do you mean? It's literally the solution for the issue this PR solves but simpler.

Phoenix616 avatar Jul 03 '25 16:07 Phoenix616

Yea that would make sense, i assume that should be included in another PR? Seems kinda off-topic for this one though( ´▽` )

What do you mean? It's literally the solution for the issue this PR solves but simpler.

Ah I see, what I thought before is to minimize diffs made by this PR, sry for my misunderstanding

HaHaWTH avatar Jul 03 '25 16:07 HaHaWTH

That's how I meant it, yea. Just that there are now some left-over comments regarding the climbing option which shouldn't really be necessary as that feature does not touch this method anymore.

Done.

HaHaWTH avatar Jul 05 '25 13:07 HaHaWTH