I was working casually on well... something and have notice that if you set one NBT value when block is placed
to for example 5 and do simple maths to apply new value using previous value than weird stuff happen's
example
On Block Placed I will set tag value:
Generate = 5
Than I will do simple maths to apply this to another block so
Set NBT tag value Energy of a block at Y+1
[[Tag Generate] + [Tag Energy of a block at Y+1]]
Logic say that it will be adding +5 to block above however for some odd reason if taking value from 2 different blocks
it will
1. generate only by 1
2. it reverse operators so + is - and - is +
I'm providing example
Take a look at 2 last procedures
SolarT1Generator and EnergyHarvestGetAndApply
In game right click on energy harvester
NOTE: I have applied limits there but you still can see its going to -4 for some reason
PS: Changing logical tag in gui threw GUI button is not working :L
Issue comments
With Numerical 2020.1 didn't have any issues
With Logical it had sometimes
I noticed that if there is no block at X-1 for example that have required variable than it will be decreasing its value however if block with required values exist there than it will not gonna decrease it
If ops < 0:
this is not the case so it goes to else if which mathces (ops = 0, 0 < 200)
it checks for opsgen 4 times, if the block has no nbt value, -1 is returned, 4*-1 -> -4
next tick, ops < 0 mathces so ops is set back to 0
Value alternates between -4 and 0 each tick and when you right click on the block, you get one of the two possible values 0 or -4.
If I place SOLART1 on all 4 sides, values stop alternating as expected as get nbt procedure block is no longer returning -1 for the nbt values on the locations where there were no blocks before.
OK I guess I'm just stupid, I will fix my stupid maths loginc
but there is still that issue with Logical tag :L
This should swith Tag to True if tag is False and vice versa but it only switches one time
And If I use Else If here than it will swith from F to T than T to F and get stuck again
Did this happen in 2020.1 too?