Gamemode4Dev / GM4_Datapacks

Gamemode 4 is a collection of modular Minecraft Datapacks that change or expand on the vanilla experience whilst keeping the vanilla feel. Our modules are developed with a focus on usability and efficiency.
https://gm4.co
GNU General Public License v3.0
110 stars 56 forks source link

Inconsistent raycasting techniques. #807

Open SpecialBuilder32 opened 1 year ago

SpecialBuilder32 commented 1 year ago

Different modules use inconsistent techniques for raycasting from the player to a block they just placed or interacted with.

It is possible to raycast without the need for a temporary entity (AEC or Marker), and this is likely preferable for performance (less selector resolution). Note Block Interface uses this technique currently, see that for reference. Note that raycasting for the sake of block placement will need some additional checks; see backup ray behavior in lib_brewing

This bug will track the conversion of the scattered raycasting methods to entityless versions.

any additional instances, please comment in this bugs thread and this main comment will be updated.

Bloo-dev commented 1 year ago

It would be so nice if we could somehow pass parameters to functions and dynamically call functions, Then we could make a library for this and avoid this issue by reducing duplicate code.

I guess this would be possible if we had something like beet parse the files and generate the raycast, but that would make development quite a bit more complicated.

SpecialBuilder32 commented 1 year ago

That was the thought I had. There was a discussion with some of the beet/bolt people in #technical regarding some of the things gm4 should consider if we started incorporating beet into development more fully. https://discord.com/channels/151141188961828864/294610104270192651/1031763397483700304

Though I also think we shouldn't move to incorporate beet/bolt into any existing modules until we've like, tried making a new one entirely in the beet ecosystem