Improve biome generator performance when interpolators match each other

This commit is contained in:
cyberpwn
2021-09-12 07:46:24 -04:00
parent 7d0555fb67
commit cd7f192fba
3 changed files with 32 additions and 19 deletions

View File

@@ -31,7 +31,8 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
@Snippet("interpolator")
import java.util.Objects;
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@@ -50,6 +51,11 @@ public class IrisInterpolator {
@Desc("The range checked horizontally. Smaller ranges yeild more detail but are not as smooth.")
private double horizontalScale = 7;
public int hashCode()
{
return Objects.hash(horizontalScale, function);
}
public double interpolate(double x, double z, NoiseProvider provider) {
return interpolate((int) Math.round(x), (int) Math.round(z), provider);
}