Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.12.2] Exploding Nested LittleTiles Structure May Lead to Crash #1060

Open
littlecube8152 opened this issue Feb 12, 2025 · 0 comments
Open

Comments

@littlecube8152
Copy link

What

Exploding nested LittleTiles structures can crash the game. One instance of the crash report is as follows.

crash-2025-02-12_22.58.31-server.txt

Additionally, the log will be flooded by messages like these:

partial-latest.log

Reproduction

  1. Use Little Importer to import this block:
{tiles:[{boxes:[[I;1,0,1,2,16,15],[I;2,1,1,15,16,2],[I;14,1,2,15,16,15],[I;2,0,1,15,1,15],[I;1,16,1,2,31,15],[I;2,30,2,15,31,15],[I;2,16,1,15,31,2],[I;14,16,2,15,30,15]],tile:{block:"minecraft:planks"}}],min:[I;1,0,1],size:[I;14,31,15],children:[{tiles:[{boxes:[[I;3,1,6,4,13,13],[I;4,1,6,13,11,13],[I;4,11,6,12,13,12],[I;4,12,12,13,13,13],[I;12,11,6,13,12,13],[I;12,12,6,13,13,12]],tile:{block:"minecraft:sandstone:2"}},{bBox:[I;4,11,12,12,12,13],tile:{invisible:1b,block:"littletiles:ltstorageblocktile"}}],count:7,dynamic:1b,structure:{stackSizeLimit:64,invisibleStorage:1b,lastSlot:8,filled:65528,numberOfSlots:1,dynamic:1b,id:"storage",accessed:0,inventory:{size:1,slot0:{id:"minecraft:tnt",Count:1b,Damage:0s}},inventorySize:8}},{tiles:[{boxes:[[I;3,13,6,13,16,13],[I;3,16,6,4,25,13],[I;4,16,6,13,23,13],[I;4,23,6,12,25,12],[I;4,24,12,13,25,13],[I;12,23,6,13,24,13],[I;12,24,6,13,25,12]],tile:{block:"minecraft:sandstone:2"}},{bBox:[I;4,23,12,12,24,13],tile:{invisible:1b,block:"littletiles:ltstorageblocktile"}}],count:8,dynamic:1b,structure:{stackSizeLimit:64,invisibleStorage:1b,lastSlot:8,filled:65528,numberOfSlots:1,dynamic:1b,id:"storage",accessed:0,inventory:{size:1,slot0:{id:"minecraft:tnt",Count:1b,Damage:0s}},inventorySize:8}},{tiles:[{boxes:[[I;1,0,15,15,16,16],[I;1,16,15,15,31,16]],tile:{block:"minecraft:bone_block"}}],count:2,dynamic:1b,structure:{clockwise:1b,activateParent:0b,opened:1b,axis:1,rot-type:0,duration:10,axisCenter:[I;14,0,15,15,1,16,16],interpolation:0,sounds:1b,dynamic:1b,id:"door",state:{mode:"TOGGLE",delay:0,state:0},events:[],disableRightClick:0b}}],count:8,structure:{blocks:[I;],id:"fixed"}}
  1. Place down multiple of them and explode them with TNT.
  2. Repeat step 2 until the crash happens.

Some notes:

  • The crash seems to be chance-based. Putting down several such structures and blow them up at once is more likely to trigger it. However, it can still happen when blowing up one at a time.
  • The structure is not the only one that can induce this crash. Blowing LittleTiles locker blocks causes a crash (Important!) SymmetricDevs/Supersymmetry#1289 includes another example.
  • The structure above is made from three components: trim made from wood block, door made from bone block, and storage made from smooth sandstone.

Technical Investigation

I have only roughly traced the code but it seems that when a structure is exploded, LittleStructure.onLittleTileDestroy() will be called, and perhaps multiple components are removed from the game. However, the following handler

public void onBlockExploded(World world, BlockPos pos, Explosion explosion) {
TileEntityLittleTiles te = loadTe(world, pos);
if (te != null) {
te.updateTiles((x) -> {
ParentTileList parent = x.noneStructureTiles();
for (LittleTile tile : parent)
tile.onTileExplodes(parent, explosion);
parent.clear();
for (StructureTileList list : x.structures())
try {
list.getStructure().onLittleTileDestroy();
} catch (CorruptedConnectionException | NotYetConnectedException e) {
e.printStackTrace();
}
});
}
}

list.getStructure().onLittleTileDestroy(); does not check if the current StructureTileList is removed or not (since a StructureTileList can only have parent of null when its removed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant