Goldorion/Array-Lists-MCreator

Array output displaying only the third value correctly. 2023.2

Closed this issue · 2 comments

I was attempting to use the array plugin you designed to store a series of X, Y and Z co-ords for some Ore locations offsets in my code. The problem is, that when I use the block "Get Value at index ___ of _____ as a number" only the third value appears. The other two, X and Z values become zero. This isn't a problem with the array, or storing the information in the array, as printing out the entire array yields the correct results. The problem appears to happen with the procedure block itself. I have hopefully linked an image of the procedure blocks used to get my problem, along with the output from that procedure.

image

If the image successfully added then you can see the procedure blocks. The first one is calling on a procedure called "Ore_distribution" that creates the array in question. The next line Prints out the entire array as is into the game chat. The next line will then go through all 21 elements of the array and print them out. (I am aware that y is meant to come before z, it just helped to have them out of order while making my code)

The out put of this code in the minecraft chat is as such...
image

If this image successfully submitted, you will see that in the case of the first location the numbers should be 1, 27, then 15. It however displays 0, 0 then 15. This pattern continues, meaning only every third item will retain its value. Is there something I am overlooking, or is this a bug?

Side note: I also attempted to use the pink procedure block "get the value at index ___ of ____" it did not work however, as the data is stored as an object not a double, meaning I could not do any math on it.

Apologies if I have left out some necessary information on my post, as this is my first time leaving a bug request. Have a great day!

I have only just noticed that the version I am using 2023.2 is written as EAP... I'm unsure what that stands for, but I'm going to presume it means that this version is a work in progress and that might be why it's not working. Sorry if that is the case.

So sorry about everything. I found the source of the problem, or the source of the bug anyway? The reason only the y axis was showing is because of some weird behavior I found. Please refer to the following image for clarification.
image
This is the code that was used to generate the x, y and z locations. The first two, the X and Z were the problem, and that is entirely due to that single "Round" function block. While it is inside of the array assigning, it causes it to output a zero when the procedure block calls for it. (As seen in the first and second images) For what reason I'm not sure. However in the case of the Y axis, the rounding was done outside of this, thus not affecting it.

The solution is simple, create a local variable, and assign it the number and round there, then append it to the array. The other option is just not to round, which is also perfectly valid. My problem with the code has been resolved, but this is still weird behavior, so I don't want to close this just yet. I'm sorry if I've given you a lot to read.