Thaumic Computers

Thaumic Computers

3M Downloads

Dioptra extension

Szasdragon opened this issue ยท 8 comments

commented

The computer could be read the Vis and Flux level values in the Dioptria's detection range. The "TileDioptra.java" has a public, byte array called "grid_amt". I suggest two new callbacks. With this, we don't need 144 Dioptra, just to monitor the surrounding aura.

commented

Thanks for the beta. I don't know how compile this project.
I tested the Dioptra map calls with parameter 7. It's works well. I can access any individual chunk Vis or Flux level.
In the documentation I would include:
"The list start from north (-Z) west (-X) corner and end in the south (+Z) east (+X) corner."
If it will merge with the master branch, I begin to develop a flux alarm program.

commented

Also tested with other parameters.

Parameter; List Size

6+; 169

6; 169

5; 121

4; 81

3; 49

2; 25

1; 9

0; 1 (same as GetVis() or GetFlux() method)

0-; 0 (Hmm... interesting... can it bee considered as an empty list?)

The parameter should be kept in range? [1; 6]

commented

Update to the mod description, after merging:

Thaumic Dioptra:

  1. Place an Adapter next to a Dioptra.
  2. The connected computer can query levels of the Vis and Flux from the chunks.
    Calling metods:
    getVis():float - Get the Vis in the current chunk.
    getFlux():float - Get the Flux in the current chunk.
    getVisMap():list(float) - Get the Vis in the surrounding N (<7) chunk radius. The list first entry the North-West (-X; -Z) chunk, toward East and South (+X; +Z).
    getFluxMap():list(float) - Get the Flux in the surrounding N (<7) chunk radius. The list first entry the North-West (-X; -Z) chunk, toward East and South (+X; +Z).
commented

If I've understood it correctly grid_amt is a 13x13 array of the vis or flux values in the surrounding aura chunks, depending on the current state of whether the dioptra block is displaying vis or flux values.
The existing callbacks in the dioptra driver just use the aurahelper class to check vis and flux levels in the chunk the dioptra TE is in.
I think I could fetch the current value of grid_amt and be able to figure out whether its vis or flux values. It would possibly be useful to be able to toggle the mode of the dioptra to be able to get the other type of value array.
Alternatively, the callbacks could calculate an equivalent array of values for each of vis and flux and return those.

commented

I think it stores both of them. I used "Show Java" decompiler on my tablet. I only have methods present in thaumcraft java. Everything else outside from this have only reference names.

commented

Also I can't math. 13^2 = 169 ๐Ÿ˜‘

commented

The magic in the dioptra is in the update() function. This is called during server ticks.
Line 44 (per the output of my decompiler) checks the block metatdata 'enabled' parameter, and depending on what it finds populates the grid_amt array with either vis values or flux values.
That block property is toggled by right-clicking the block. (BlockDioptra.class, line 57)
My guess is the block rendering handles checking which state its in to change the color that the grid map on the block is drawn. I don't understand GUI stuff yet.

So, just reading the array by itself, you don't necessarily know if the values you're getting are vis or flux. The function could probably also expose a flag for which is which by likewise checking the block metadata.
I think it would be more useful to just make the array of each type available to the computer upon demand.