Podshot / MCEdit-Unified-Preview

Other
27 stars 5 forks source link

Modifying the chunk.tileEntities may be unreliable #6

Closed abrightmoore closed 6 years ago

abrightmoore commented 6 years ago

This has been tested with 1.6.0.18 on a Java 1.12.2 world.

A test filter to reproduce the issue is here: https://github.com/abrightmoore/MCEdit-PYMCLEVEL-Test-Cases/blob/master/TWF_TESTCHESTTE_v1.py

Steps to reproduce:

  1. Fill a selection box with south facing chests
  2. Run the filter with the checkbox to cause the issue set to 'true'
  3. Check the console for output of the form: ((7, 8, 19), '', '', [], '', 0) ((7, 9, 17), '', '', [], '', 0) ((7, 9, 19), '', '', [], '', 0) ((7, 10, 17), '', '', [], '', 0) ((7, 10, 19), '', '', [], '', 0) ((7, 11, 17), '', '', [], '', 0)

If there are lines as shown above then there are empty chests in the selection even though the script has created at least one item in each chest.

The problem appears to be with removing and re-adding entities to the chunk.tileEntities list.

abrightmoore commented 6 years ago

Simplified the test case further so the chunk's tile entities aren't being modified while iterating over them.

It is here: https://github.com/abrightmoore/MCEdit-PYMCLEVEL-Test-Cases/blob/master/TWF_TESTCHESTTE_v2.py

abrightmoore commented 6 years ago

Not an issue - caused by modifying the chunk tile entities while iterating over them.

Working version in v3 of test case.