Skip to content

Reactors are not rotationally invariant #781

Description

@JulGvoz

Issue description

Reactors update blocks in a specific order (based on the order they were put in the HashMap in init method in ReactorControllerBlockEntity). This order is dependent on the orientation of the reactor, and also JVM dependent!

The issue arises in two ways:

  1. Heat mechanics are non-obvious, since sometimes heat is first produced, then spread; other times it is first spread, then produced. The stable heat values can be subtly different between the two cases.
  2. Thus reactors might change in behaviour if rotated, possibly no longer being safe.

The fix to this would be to treat the reactor like a cellular automaton, and do a two phase scan. First compute new values using the old values, then set the values.

P.S.: it would also be nice if the temperature was a float/double instead of an int, since then the reactor would actually converge to a stable temperature, instead of some blocks fluctuating in some configurations.

Steps to reproduce

I do not have a concrete reactor design that causes an issue. The idea would be to build a reactor where if the rods produce first, then the heat is spread second, then it does not overheat, while in another orientation, it would overheat.

Minecraft version

1.21.1 (Latest)

Platform

Neoforge

Loader version

Oritech version

Other relevant versions

No response

If a (crash)log is relevant for this issue, link it here: (It's almost always relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions