.addDisplayValue(3, "Normal"),
(id, x, y, width) -> new BoundingBoxTypeButton(id, x, y, width, "Biome Borders", BoundingBoxType.BiomeBorder),
- (id, x, y, width) -> new BoolSettingButton(id, x, y, width, "Only This Biome", ConfigManager.renderOnlyCurrentBiome),
+ (id, x, y, width) -> new MaxYSettingSlider(id, x, y, width, 1, ConfigManager.biomeBordersMaxY),
(id, x, y, width) -> new IntSettingSlider(id, x, y, width, 1, 3, "Distance", ConfigManager.biomeBordersRenderDistance)
.addDisplayValue(1, "Nearest")
.addDisplayValue(2, "Nearer")
private static Coords lastPlayerCoords = null;
private static Boolean lastRenderAllTransitions = null;
private static Integer lastRenderDistance = null;
+ private static Integer lastMaxY = null;
private static Map<Coords, BoundingBoxBiomeBorder> lastBorders = new HashMap<>();
public Iterable<BoundingBoxBiomeBorder> get(int dimensionId) {
Coords playerCoords = Player.getCoords();
Integer renderDistance = ConfigManager.biomeBordersRenderDistance.get();
Boolean renderAllTransitions = !ConfigManager.renderOnlyCurrentBiome.get();
- if (!playerCoords.equals(lastPlayerCoords) || !renderDistance.equals(lastRenderDistance) || renderAllTransitions != lastRenderAllTransitions) {
+ Integer maxY = (int)Player.getMaxY(ConfigManager.biomeBordersMaxY.get());
+ if (!playerCoords.equals(lastPlayerCoords) ||
+ !renderDistance.equals(lastRenderDistance) ||
+ renderAllTransitions != lastRenderAllTransitions ||
+ !maxY.equals(lastMaxY)) {
lastPlayerCoords = playerCoords;
lastRenderDistance = renderDistance;
lastRenderAllTransitions = renderAllTransitions;
+ lastMaxY = maxY;
lastBorders = getBiomeBorders();
}
return lastBorders.values();
}
private Map<Coords, BoundingBoxBiomeBorder> getBiomeBorders() {
- Integer renderDistance = lastRenderDistance;
+ int renderDistance = lastRenderDistance;
Coords playerCoords = lastPlayerCoords;
boolean renderAllTransitions = lastRenderAllTransitions;
+ int maxY = lastMaxY;
int width = MathHelper.floor(Math.pow(2, 3 + renderDistance));
+
int blockX = playerCoords.getX();
int minX = blockX - width;
int maxX = blockX + width;
- int blockY = playerCoords.getY();
-
int blockZ = playerCoords.getZ();
int minZ = blockZ - width;
int maxZ = blockZ + width;
int matchX = (x - minX);
for (int z = minZ; z <= maxZ; z++) {
int matchZ = (z - minZ);
- biomeIds[matchX][matchZ] = BiomeBorderHelper.getBiomeId(x, blockY, z);
+ biomeIds[matchX][matchZ] = BiomeBorderHelper.getBiomeId(x, maxY, z);
}
}
int z = matchZ + minZ;
int biomeId = biomeIds[matchX][matchZ];
if (renderAllTransitions || biomeId == playerBiomeId) {
- Coords coords = new Coords(x, blockY, z);
+ Coords coords = new Coords(x, maxY, z);
if (lastBorders.containsKey(coords)) {
borders.put(coords, lastBorders.get(coords));
} else {
public static Setting<Boolean> drawBiomeBorders;
public static Setting<Boolean> renderOnlyCurrentBiome;
public static Setting<Integer> biomeBordersRenderDistance;
+ public static Setting<Integer> biomeBordersMaxY;
public static void loadConfig(File mcConfigDir) {
configDir = new File(mcConfigDir, "config");
drawBiomeBorders = setup(config, "biomeBorders", "drawBiomeBorders", true, "If set to true biome borders will be drawn.");
renderOnlyCurrentBiome = setup(config, "biomeBorders", "renderOnlyCurrentBiome", true, "If set to true only the biome border for the current biome will be drawn.");
biomeBordersRenderDistance = setup(config, "biomeBorders", "biomeBordersRenderDistance", 3, "The distance from the player where biome borders will be drawn.");
+ biomeBordersMaxY = setup(config, "biomeBorders", "biomeBordersMaxY", -1, "The maximum top of the biome borders. If set to -1 it will use the value when activated, if set to 0 it will always track the players feet.");
drawVillageSpheres = setup(config, "villages", "drawVillageSpheres", true, "If set to true village bounding spheres are drawn.");
drawIronGolemSpawnArea = setup(config, "villages", "drawIronGolemSpawnArea", true, "If set to true the iron golem spawn area of the village will be drawn. (default:true)");