Fixed mirror filter not accoounting for data
This commit is contained in:
@@ -22,9 +22,7 @@ public abstract class GenerateFilter implements Cloneable{
|
||||
long[] buffer = new long[tiles.width * tiles.height];
|
||||
|
||||
for(int i = 0; i < tiles.width * tiles.height; i++){
|
||||
Tile tile = tiles.geti(i);
|
||||
|
||||
in.set(tile.x, tile.y, tile.block(), tile.floor(), tile.overlay());
|
||||
in.set(tiles.geti(i));
|
||||
apply(in);
|
||||
|
||||
buffer[i] = PackTile.get(in.block.id, in.floor.id, in.overlay.id);
|
||||
@@ -48,7 +46,7 @@ public abstract class GenerateFilter implements Cloneable{
|
||||
}
|
||||
}else{
|
||||
for(Tile tile : tiles){
|
||||
in.set(tile.x, tile.y, tile.block(), tile.floor(), tile.overlay());
|
||||
in.set(tile);
|
||||
apply(in);
|
||||
|
||||
if(in.floor instanceof Floor floor){
|
||||
@@ -59,6 +57,7 @@ public abstract class GenerateFilter implements Cloneable{
|
||||
if(!tile.block().synthetic() && !in.block.synthetic()){
|
||||
tile.setBlock(in.block);
|
||||
}
|
||||
tile.setPackedData(in.packedData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,15 +147,21 @@ public abstract class GenerateFilter implements Cloneable{
|
||||
|
||||
/** output parameters */
|
||||
public Block floor, block, overlay;
|
||||
public long packedData;
|
||||
|
||||
TileProvider buffer;
|
||||
|
||||
public void set(int x, int y, Block block, Block floor, Block overlay){
|
||||
public void set(int x, int y, Block block, Block floor, Block overlay, long packedData){
|
||||
this.floor = floor;
|
||||
this.block = block;
|
||||
this.overlay = overlay;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.packedData = packedData;
|
||||
}
|
||||
|
||||
public void set(Tile tile){
|
||||
set(tile.x, tile.y, tile.block(), tile.floor(), tile.overlay(), tile.getPackedData());
|
||||
}
|
||||
|
||||
public void begin(int width, int height, TileProvider buffer){
|
||||
|
||||
@@ -47,6 +47,7 @@ public class MirrorFilter extends GenerateFilter{
|
||||
in.block = tile.block();
|
||||
}
|
||||
in.overlay = tile.overlay();
|
||||
in.packedData = tile.getPackedData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user