diff --git a/src/main/java/ca/recrown/islandsurvivalcraft/interaction/items/variations/IslandMapItem.java b/src/main/java/ca/recrown/islandsurvivalcraft/interaction/items/variations/IslandMapItem.java index 00bccd1..5ece7df 100644 --- a/src/main/java/ca/recrown/islandsurvivalcraft/interaction/items/variations/IslandMapItem.java +++ b/src/main/java/ca/recrown/islandsurvivalcraft/interaction/items/variations/IslandMapItem.java @@ -68,13 +68,23 @@ public class IslandMapItem extends MapRenderer implements VariedItem { for (int y = 0; y < 128; y ++) { int actualX = blocksPerPixel * (x - Byte.MAX_VALUE/2) + map.getCenterX(); int actualZ = blocksPerPixel * (y - Byte.MAX_VALUE/2) + map.getCenterZ(); - byte baseColorVal = canvas.getBasePixel(x, y); - Color baseColor = MapPalette.getColor(baseColorVal); Point2 pCoords = new Point2(actualX, actualZ); IslandInformation info = islandInformationManager.getIslandInformation(pCoords, false); if (info != null) { - Color mixed = new Color((int) Math.min(255, baseColor.getRed() * 1.5f), (int) Math.min(255, baseColor.getGreen() * 0.7f), (int) Math.min(255, baseColor.getBlue() * 0.44f)); - canvas.setPixel(x, y, MapPalette.matchColor(mixed)); + byte baseColorVal = canvas.getBasePixel(x, y); + Color mainColor = new Color(255, 120, 70); + Color baseColor = null; + if (baseColorVal != 0) { + baseColor = MapPalette.getColor(baseColorVal); + } else { + baseColor = new Color(1f, 1f, 1f); + } + Color resultingColor = new Color( + (mainColor.getRed() * baseColor.getRed())/(255f * 255f), + (mainColor.getGreen() * baseColor.getGreen())/(255f * 255f), + (mainColor.getBlue() * baseColor.getBlue())/(255f * 255f) + ); + canvas.setPixel(x, y, MapPalette.matchColor(resultingColor)); } } } diff --git a/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/shaders/WorldLayerShader.java b/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/shaders/WorldLayerShader.java index a04f2f8..3323b86 100644 --- a/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/shaders/WorldLayerShader.java +++ b/src/main/java/ca/recrown/islandsurvivalcraft/world/generation/shaders/WorldLayerShader.java @@ -80,7 +80,7 @@ public class WorldLayerShader { } } } else if (mainBiomeName.contains("mountain")) { - if (y > (maxHeight * 0.48d) - getNormalizedNoise(worldX, worldZ, 2.2f) * 8d) { + if (y > (maxHeight * 0.36d) - getNormalizedNoise(worldX, worldZ, 2.2f) * 8d) { res = Material.STONE.createBlockData(); } else if (y > highestPoint - getSurfaceThickness(worldX, worldZ, mainBiome)) { res = getSurfaceMaterial(mainBiome).createBlockData(); @@ -98,7 +98,7 @@ public class WorldLayerShader { return Material.SAND; } else if (biome == Biome.ICE_SPIKES) { return Material.SNOW_BLOCK; - } else if (biomeName.contains("ocean")) { + } else if (biomeName.contains("ocean") || biomeName.contains("gravelly")) { return Material.GRAVEL; } else if (biomeName.contains("stone")) { return Material.STONE; @@ -109,8 +109,10 @@ public class WorldLayerShader { public int getSurfaceThickness(int worldX, int worldZ, Biome biome) { String biomeName = biome.toString().toLowerCase(); - if (biomeName.contains("beach")) { + if (biomeName.contains("beach") || biomeName.contains("desert")) { return (int) (getNormalizedNoise(worldX, worldZ, 1.3f) * 5) + 4; + } else if (biomeName.contains("gravelly")) { + return (int) (getNormalizedNoise(worldX, worldZ, 1.3f) * 5); } return 1; }