Added support for export/import of all basic terrain as image

This commit is contained in:
Anuken
2020-02-26 19:37:22 -05:00
parent fdaac290ac
commit 1e53ea50b0
19 changed files with 154 additions and 225 deletions

View File

@@ -21,7 +21,7 @@ public class Cliff extends Block{
int r = tile.rotation();
for(int i = 0; i < 8; i++){
if((r & (1 << i)) != 0){
Draw.color(Tmp.c1.set(tile.floor().color).mul(1.3f + (i >= 4 ? -0.4f : 0.3f)));
Draw.color(Tmp.c1.set(tile.floor().minimapColor).mul(1.3f + (i >= 4 ? -0.4f : 0.3f)));
Draw.rect(region, tile.worldx(), tile.worldy(), 11f, 11f, i * 45f);
}
}
@@ -31,6 +31,6 @@ public class Cliff extends Block{
@Override
public int minimapColor(Tile tile){
return Tmp.c1.set(tile.floor().color).mul(1.2f).rgba();
return Tmp.c1.set(tile.floor().minimapColor).mul(1.2f).rgba();
}
}

View File

@@ -110,7 +110,7 @@ public class Floor extends Block{
if(wall == null) wall = Blocks.air;
if(decoration == Blocks.air){
decoration = content.blocks().min(b -> b instanceof Rock && b.breakable ? color.diff(b.color) : Float.POSITIVE_INFINITY);
decoration = content.blocks().min(b -> b instanceof Rock && b.breakable ? minimapColor.diff(b.minimapColor) : Float.POSITIVE_INFINITY);
}
}
@@ -219,7 +219,7 @@ public class Floor extends Block{
for(int i = 0; i < 4; i++){
Tile other = tile.getNearby(i);
if(other != null && doEdge(other.floor(), sameLayer)){
Color color = other.floor().color;
Color color = other.floor().minimapColor;
Draw.color(color.r, color.g, color.b, 1f);
Draw.rect(edgeRegion, tile.worldx(), tile.worldy(), i*90);
}

View File

@@ -19,7 +19,7 @@ public class OreBlock extends OverlayFloor{
this.localizedName = ore.localizedName;
this.itemDrop = ore;
this.variants = 3;
this.color.set(ore.color);
this.minimapColor.set(ore.color);
}
/** For mod use only!*/
@@ -31,7 +31,7 @@ public class OreBlock extends OverlayFloor{
public void setup(Item ore){
this.localizedName = ore.localizedName;
this.itemDrop = ore;
this.color.set(ore.color);
this.minimapColor.set(ore.color);
}
@Override