<commit_before>package net.wayward_realms.waywardlib.util.heightmap;

import org.bukkit.Location;

import java.util.Arrays;
import java.util.Vector;

public class WaywardHeightMap {

    private int max;
    private Vector<WaywardHeightMapPoint> points;

    @SuppressWarnings("unchecked")
    WaywardHeightMap(WaywardHeightMapPoint... inputPoints){
        int testMax = 0;
        this.points = (Vector) Arrays.asList(inputPoints);
        //Find maximum point, in preparation for normalization.
        for(WaywardHeightMapPoint point: points){
            points.add(point);
            if(point.getValue() > testMax){
                testMax = point.getValue();
            }
        }
        this.max = testMax;
        //Normalize, and then smooth/flatten out the heights.
        for(WaywardHeightMapPoint point: points){
            point.setValue((point.getValue()/max)^2);
        }
    }

    public int getheight(Location location){
        int testY = location.getBlockY();
        int testX = location.getBlockX();
        int out = 0;
        for(WaywardHeightMapPoint point : points){
            int thisHeight =  ((point.getValue()^2) - ( ((testX - point.getX())^2) + ((testY - point.getY())^2)));
            if(thisHeight > out){
                out = thisHeight;
            }
        }
        return out * max;
    }

    public boolean addpoint(WaywardHeightMapPoint point){
        this.points.add(point);
        return this.points.contains(point);
    }

    public Vector<WaywardHeightMapPoint> getPoints(){
        return points;
    }
}
<commit_msg>Finished WaywardHeightMap implementation of spheres, and scaling of spheres.<commit_after>package net.wayward_realms.waywardlib.util.heightmap;

import org.bukkit.Location;

import java.util.Arrays;
import java.util.Vector;

public class WaywardHeightMap {

    private int scale;
    private Vector<WaywardHeightMapPoint> points;

    private int max;

    @SuppressWarnings("unchecked")
    WaywardHeightMap(int scale, WaywardHeightMapPoint... inputPoints){
        this.scale = scale;
        int testMax = 0;
        this.points = (Vector) Arrays.asList(inputPoints);
        //Find maximum point, in preparation for normalization.
        for(WaywardHeightMapPoint point: points){
            points.add(point);
            if(point.getValue() > testMax){
                testMax = point.getValue();
                point.setValue(point.getValue());
            }
        }
        this.max = testMax;
        //Normalize, and then smooth/flatten out the heights.
        for(WaywardHeightMapPoint point: points){
            point.setValue((point.getValue()/(max))^2);
        }
    }

    public int getheight(Location location){
        int testY = location.getBlockY();
        int testX = location.getBlockX();
        int out = 0;
        for(WaywardHeightMapPoint point : points){
            int thisHeight =  ((point.getValue() * point.getValue() * scale * scale) - ( ((testX - point.getX())*(testX - point.getX())) + ((testY - point.getY())*(testY - point.getY()))));
            if(thisHeight/(scale * scale) > out){
                out = thisHeight/(scale * scale);
            }
        }
        return out * max;
    }

    public boolean addpoint(WaywardHeightMapPoint point){
        this.points.add(point);
        return this.points.contains(point);
    }

    public Vector<WaywardHeightMapPoint> getPoints(){
        return points;
    }
}

{'fraction_non_alphanumeric': 0.11517261386713083, 'fraction_numerical': 0.0026109660574412533, 'mean_word_length': 2.347572815533981, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3961420', 'n_tokens_mistral': 996, 'n_tokens_neox': 962, 'n_words': 215}