Block icon rework / Dynamic icon generation / Tech tree tweaks
This commit is contained in:
@@ -205,7 +205,7 @@ public class BlockIndexer{
|
||||
for(int x = Math.max(0, tile.x - oreQuadrantSize / 2); x < tile.x + oreQuadrantSize / 2 && x < world.width(); x++){
|
||||
for(int y = Math.max(0, tile.y - oreQuadrantSize / 2); y < tile.y + oreQuadrantSize / 2 && y < world.height(); y++){
|
||||
Tile res = world.tile(x, y);
|
||||
if(res.block() == Blocks.air && res.floor().drops != null && res.floor().drops.item == item){
|
||||
if(res.block() == Blocks.air && res.floor().itemDrop == item){
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -243,9 +243,9 @@ public class BlockIndexer{
|
||||
for(int x = quadrantX * structQuadrantSize; x < world.width() && x < (quadrantX + 1) * structQuadrantSize; x++){
|
||||
for(int y = quadrantY * structQuadrantSize; y < world.height() && y < (quadrantY + 1) * structQuadrantSize; y++){
|
||||
Tile result = world.tile(x, y);
|
||||
if( result == null || result.block().drops == null || !scanOres.contains(result.block().drops.item)) continue;
|
||||
if( result == null || result.floor().itemDrop == null || !scanOres.contains(result.floor().itemDrop)) continue;
|
||||
|
||||
itemSet.add(result.block().drops.item);
|
||||
itemSet.add(result.floor().itemDrop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -322,8 +322,8 @@ public class BlockIndexer{
|
||||
Tile tile = world.tile(x, y);
|
||||
|
||||
//add position of quadrant to list when an ore is found
|
||||
if(tile.floor().drops != null && scanOres.contains(tile.floor().drops.item) && tile.block() == Blocks.air){
|
||||
ores.get(tile.floor().drops.item).add(world.tile(
|
||||
if(tile.floor().itemDrop != null && scanOres.contains(tile.floor().itemDrop) && tile.block() == Blocks.air){
|
||||
ores.get(tile.floor().itemDrop).add(world.tile(
|
||||
//make sure to clamp quadrant middle position, since it might go off bounds
|
||||
Mathf.clamp(qx * oreQuadrantSize + oreQuadrantSize / 2, 0, world.width() - 1),
|
||||
Mathf.clamp(qy * oreQuadrantSize + oreQuadrantSize / 2, 0, world.height() - 1)));
|
||||
|
||||
Reference in New Issue
Block a user