Merge branch 'master' into feature/lowres

This commit is contained in:
Lukas Rieger (Blue) 2022-08-08 21:29:50 +02:00
commit 7d14ca4a29
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
5 changed files with 11 additions and 11 deletions

View File

@ -150,7 +150,7 @@ public void setFrom(WebappConfig config) {
this.resolutionDefault = config.getResolutionDefault();
this.hiresSliderMax = config.getHiresSliderMax();
this.hiresSliderDefault = config.getLowresSliderDefault();
this.hiresSliderDefault = config.getHiresSliderDefault();
this.hiresSliderMin = config.getHiresSliderMin();
this.lowresSliderMax = config.getLowresSliderMax();

View File

@ -87,7 +87,7 @@ public void render(World world, Vector3i modelMin, Vector3i modelMax, HiresTileM
//update color and height (only if not 100% translucent)
if (blockColor.a > 0) {
maxHeight = y;
columnColor.overlay(blockColor);
columnColor.overlay(blockColor.premultiplied());
}
}
}

View File

@ -108,7 +108,7 @@ public void build(BlockNeighborhood<?> block, Variant variant, BlockModelView bl
}
if (color.a > 0) {
color.flatten();
color.flatten().straight();
color.a = blockColorOpacity;
}

View File

@ -165,10 +165,10 @@ public Color straight() {
@Override
public String toString() {
return "Color{" +
"r=" + r +
", g=" + g +
", b=" + b +
", a=" + a +
"r=" + r + " (" + (int) (r * 255) + ")" +
", g=" + g + " (" + (int) (g * 255) + ")" +
", b=" + b + " (" + (int) (b * 255) + ")" +
", a=" + a + " (" + (int) (a * 255) + ")" +
", premultiplied=" + premultiplied +
'}';
}

View File

@ -189,13 +189,13 @@ public void startWebserver(BlueMapService blueMap, boolean verbose) throws IOExc
routingRequestHandler.register(".*", new FileRequestHandler(config.getWebroot()));
// map route
for (var mapId : blueMap.getConfigs().getMapConfigs().keySet()) {
Storage storage = blueMap.getStorage(mapId);
for (var mapConfigEntry : blueMap.getConfigs().getMapConfigs().entrySet()) {
Storage storage = blueMap.getStorage(mapConfigEntry.getValue().getStorage());
routingRequestHandler.register(
"maps/" + Pattern.quote(mapId) + "/(.*)",
"maps/" + Pattern.quote(mapConfigEntry.getKey()) + "/(.*)",
"$1",
new MapRequestHandler(mapId, storage)
new MapRequestHandler(mapConfigEntry.getKey(), storage)
);
}