CustomBiomeGenerator class
Пакет: com.hypixel.hytale.server.worldgen.biome
Файл: com/hypixel/hytale/server/worldgen/biome/CustomBiomeGenerator.java
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
NoiseProperty |
noiseProperty |
|
double |
var10 |
|
double |
var8 |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
int |
getPriorityint getPriority() |
public |
boolean |
isThresholdboolean isThreshold(double var1) |
public |
boolean |
isThresholdboolean isThreshold(double var1, double var3) |
public |
boolean |
isValidParentBiomeboolean isValidParentBiome(int var1) |
public |
boolean |
shouldGenerateAtboolean shouldGenerateAt(int var1, double var2, double var4, @Nonnull ZoneGeneratorResult var6, @Nonnull Biome var7) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.biome;
class="kw">import com.hypixel.hytale.procedurallib.condition.IDoubleThreshold;
class="kw">import com.hypixel.hytale.procedurallib.condition.IIntCondition;
class="kw">import com.hypixel.hytale.procedurallib.property.NoiseProperty;
class="kw">import com.hypixel.hytale.server.worldgen.zone.ZoneGeneratorResult;
class="kw">import javax.annotation.Nonnull;
class="kw">public class CustomBiomeGenerator {
class="kw">protected class="kw">final NoiseProperty noiseProperty;
class="kw">protected class="kw">final IDoubleThreshold threshold;
class="kw">protected class="kw">final IIntCondition biomeMask;
class="kw">protected class="kw">final int priority;
class="kw">public CustomBiomeGenerator(NoiseProperty var1, IDoubleThreshold var2, IIntCondition var3, int var4) {
this.noiseProperty = var1;
this.threshold = var2;
this.biomeMask = var3;
this.priority = var4;
}
class="kw">public boolean shouldGenerateAt(int var1, double var2, double var4, @Nonnull ZoneGeneratorResult var6, @Nonnull Biome var7) {
double var8 = this.noiseProperty.get(var1, var2, var4);
if (var6.getBorderDistance() < var7.getFadeContainer().getMaskFadeSum()) {
double var10 = var7.getFadeContainer().getMaskFactor(var6);
class="kw">return this.isThreshold(var8, var10);
} else {
class="kw">return this.isThreshold(var8);
}
}
class="kw">public boolean isThreshold(double var1) {
class="kw">return this.threshold.eval(var1);
}
class="kw">public boolean isThreshold(double var1, double var3) {
class="kw">return var3 >= 1.0E-5 && this.threshold.eval(var1, var3);
}
class="kw">public boolean isValidParentBiome(int var1) {
class="kw">return this.biomeMask.eval(var1);
}
class="kw">public int getPriority() {
class="kw">return this.priority;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "CustomBiomeGenerator{noiseProperty="
+ this.noiseProperty
+ ", threshold="
+ this.threshold
+ ", biomeMask="
+ this.biomeMask
+ ", priority="
+ this.priority
+ "}";
}
}