stonar96 / RayTraceAntiXray

Paper plugin for server-side async multithreaded ray tracing to hide ores that are exposed to air using Paper Anti-Xray engine-mode 1.
MIT License
128 stars 26 forks source link

[Feature request] Custom per block replacement #2

Closed masmc05 closed 1 year ago

masmc05 commented 1 year ago

Like if i want to set that spawners are replaced by air, not like other blocks

stonar96 commented 1 year ago

There are several reasons why this won't be added:

  1. Anti-Xray is implemented in a way (for efficiency reasons) that the block type information isn't present anymore when the replacement happens. This can be solved with a lot of effort tho.
  2. That would affect performance for everyone (even those not using the feature). Implementing this would introduce additional logic into hot code. Also note that all blocks used as a replacement must be registered into the chunk, which makes the chunk packet larger (part of the disadvantages of engine-mode: 2).
  3. I don't see a big advantage of this feature. Also note that Anti-Xray already uses different blocks as replacement for different world types and heights (i.e. deepslate).
  4. This feature would introduce breaking config changes.
  5. I think this is out of scope for this plugin. If at all, this should be added into Paper's Anti-Xray, which this plugin inherently uses. However, I don't think this will be added for the same reasons listed above.

This being said, I have tested how difficult this would be to implement and here is the diff of a quick and dirty implementation of this feature. If you are able to and if you want, you can try to compile it. I won't include this in the repo as I have no intention of supporting it.