Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

4M Downloads

[Suggestion] Middle click pick pick part

slava110 opened this issue ยท 6 comments

commented

Pick vehicle part with middle click like a block (get a copy of that part)

commented

That's actually not a bad idea. Will have to investigate how to do such a thing. I think MC reports middle-click operations...

commented

So, it turns out MC actually does not report when the player middle-clicks. Forge doesn't have an event for that either. The only thing it does do is detect a middle-click during the main tick loop and forward that click to any blocks the player is clicking. This is only for blocks; entities aren't even considered for this action. Because of this, and the lack of an event, I won't be able to add this feature. Sorry about that....

commented

@DonBruce64, what about Entity#getPickedResult(RayTraceResult target)? Can you override it and use to give certain vehicle part?

commented

That... might actually work. My dev code is all fouled up now, but I'll take a second look into this when I get the chance. My only concern is that MC has a "max distance from entity" check it performs on some calculations that prevent clicks on entities larger than about 5 blocks wide. Whether or not this will work all depends if MC does those checks before or after the method is called. Will have to see.

commented

Can confirm this is possible, and will be implemented in the next release.

commented

Added in V19.0.0.