chunky-dev / chunky

A path tracer to create realistic images of your Minecraft worlds.
https://chunky-dev.github.io/docs
GNU General Public License v3.0
633 stars 76 forks source link

Singletons (mainly `Air#INSTANCE`) and constants are incompatible with `BlockSpec#maybeWaterlogged` #1692

Open NotStirred opened 4 months ago

NotStirred commented 4 months ago

BlockSpec#maybeWaterlogged modifies the returned object; if that object is a constant any previous or future reference to that object is modified. For example if a world contains air and air + waterlogged=true then all air blocks in the entire world will be waterlogged.

Any BlockProvider implementation that returns the same object from getBlockByTag for different arguments could run into this issue.