Safety measure or Bug? Procedure doesn't execute the code.

Started by StellaeLux on Sun, 09/15/2019 - 17:30

Topic category: Help with MCreator's application

Last seen on 01:35, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Safety measure or Bug? Procedure doesn't execute the code.
Sun, 09/15/2019 - 17:31 (edited)

So I created a procedure that does something terrible:

It changes every adjecent block into a Red-Block if that adjecent block happened to be stone.

Procedure:

If Get block at x (y+1) z = stone.

do Place Red-block at  x (y+1) z

And that ^ repeated 6 times for every positive and negative adjecent xyz. (Called upon block added).

So clearly this would change nearly all stone in the world into Red-Block... however, that is not what happens.

Whenever you place it next to a small group of stone, it does indeed convert everything into Red-Block in an instance. But when you place it next to a giant block of stone (total 12k stone for example) it will not convert it all into Red-Block. It will in fact barely convert anything. And only occasianllly converts 1 adjecent block into Red-Block.

The behaviour gets even weirder when you make the block replace (thus destroy) itself at the end of the code causing it to fail to do it's job even more often.

---

So my question is; is this some sort of safety measure either by mcreator/forge/minecraft to prevent crashes when it gets too many instructions or is this a bug? How does it work and what limit of instructions in a tick would there be if?

Edited by StellaeLux on Sun, 09/15/2019 - 17:31
I am not aware of any safety…
Sun, 09/15/2019 - 18:14

I am not aware of any safety measure, but keep in mind that this approach will cause crashes due to overload in any case.

Last seen on 01:35, 18. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I changed it to "on tick"…
Sun, 09/15/2019 - 19:00

I changed it to "on tick" and made the block replace itself so it wouldn't keep checking if all its neighbours had already been changed.

This managed to completely change the underground overtime, but when adding this conversion block as "Ore that replaces X type of block", that did indeed make it crash after a while.

Strangely enough, minecraft/else this has some sort of safety measure that prevents crashes on "when block added", but doesn't do so for on tick update. Weird.

I doubt there are any safety…
Mon, 09/16/2019 - 06:17

I doubt there are any safety measures for this other than standard Java mechanisms such as stack overflow protection and similar.