|
|
@@ -39,11 +39,17 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
{ |
|
|
|
if (!BlockExists(blockID)) return new Block[0]; |
|
|
|
Stack<uint> cubeStack = new Stack<uint>(); |
|
|
|
FasterList<uint> cubesToProcess = new FasterList<uint>(); |
|
|
|
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubesToProcess, (in GridConnectionsEntityStruct g) => { return false; }); |
|
|
|
var ret = new Block[cubesToProcess.count]; |
|
|
|
for (int i = 0; i < cubesToProcess.count; i++) |
|
|
|
ret[i] = new Block(cubesToProcess[i]); |
|
|
|
FasterList<uint> cubes = new FasterList<uint>(10); |
|
|
|
var coll = entitiesDB.QueryEntities<GridConnectionsEntityStruct>(CommonExclusiveGroups |
|
|
|
.OWNED_BLOCKS_GROUP); |
|
|
|
for (int i = 0; i < coll.count; i++) |
|
|
|
coll[i].isProcessed = false; |
|
|
|
|
|
|
|
ConnectedCubesUtility.TreeTraversal.GetConnectedCubes(entitiesDB, blockID.entityID, cubeStack, cubes, (in GridConnectionsEntityStruct g) => { return false; }); |
|
|
|
|
|
|
|
var ret = new Block[cubes.count]; |
|
|
|
for (int i = 0; i < cubes.count; i++) |
|
|
|
ret[i] = new Block(cubes[i]); |
|
|
|
return ret; |
|
|
|
} |
|
|
|
|
|
|
|