UniquePrefabEntry class
Пакет: com.hypixel.hytale.server.worldgen.container
Файл: com/hypixel/hytale/server/worldgen/container/UniquePrefabContainer.java
Поля (21)
| Модификаторы | Тип | Имя |
|---|---|---|
|
protected final PrefabCategory |
category |
|
protected final BlockMaskCondition |
configuration |
|
protected final int |
environmentId |
|
protected final double |
exclusionRadiusSquared |
|
protected final boolean |
fitHeightmap |
|
protected final int |
highBoundX |
|
protected final int |
highBoundY |
|
protected final int |
highBoundZ |
|
protected final int |
lowBoundX |
|
protected final int |
lowBoundY |
|
protected final int |
lowBoundZ |
|
protected final String |
name |
|
protected final Vector3i |
position |
|
protected final WorldGenPrefabSupplier |
prefabSupplier |
|
protected final PrefabRotation |
rotation |
|
protected final boolean |
showOnMap |
|
protected final boolean |
spawnLocation |
|
protected final Vector3d |
spawnOffset |
|
protected final boolean |
submerge |
|
IPrefabBuffer |
var15 |
|
IChunkBounds |
var16 |
Методы (20)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
public PrefabCategory |
getCategorypublic PrefabCategory getCategory() |
|
public BlockMaskCondition |
getConfigurationpublic BlockMaskCondition getConfiguration() |
|
public int |
getEnvironmentIdpublic int getEnvironmentId() |
|
public double |
getExclusionRadiusSquaredpublic double getExclusionRadiusSquared() |
|
public int |
getHighBoundXpublic int getHighBoundX() |
|
public int |
getHighBoundYpublic int getHighBoundY() |
|
public int |
getHighBoundZpublic int getHighBoundZ() |
|
public int |
getLowBoundXpublic int getLowBoundX() |
|
public int |
getLowBoundYpublic int getLowBoundY() |
|
public int |
getLowBoundZpublic int getLowBoundZ() |
|
public String |
getNamepublic String getName() |
|
public Vector3i |
getPositionpublic Vector3i getPosition() |
|
public WorldGenPrefabSupplier |
getPrefabSupplierpublic WorldGenPrefabSupplier getPrefabSupplier() |
|
public PrefabRotation |
getRotationpublic PrefabRotation getRotation() |
|
public Vector3d |
getSpawnOffsetpublic Vector3d getSpawnOffset() |
|
public boolean |
isFitHeightmappublic boolean isFitHeightmap() |
|
public boolean |
isShowOnMappublic boolean isShowOnMap() |
|
public boolean |
isSpawnLocationpublic boolean isSpawnLocation() |
|
public boolean |
isSubmergepublic boolean isSubmerge() |
|
public String |
toStringpublic String toString() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.container;
class="kw">import com.hypixel.hytale.math.util.FastRandom;
class="kw">import com.hypixel.hytale.server.core.prefab.PrefabRotation;
class="kw">import com.hypixel.hytale.server.core.prefab.selection.buffer.impl.IPrefabBuffer;
class="kw">import com.hypixel.hytale.server.worldgen.chunk.ChunkGenerator;
class="kw">import com.hypixel.hytale.server.worldgen.loader.WorldGenPrefabSupplier;
class="kw">import com.hypixel.hytale.server.worldgen.prefab.PrefabCategory;
class="kw">import com.hypixel.hytale.server.worldgen.prefab.unique.UniquePrefabConfiguration;
class="kw">import com.hypixel.hytale.server.worldgen.prefab.unique.UniquePrefabGenerator;
class="kw">import com.hypixel.hytale.server.worldgen.util.bounds.IChunkBounds;
class="kw">import com.hypixel.hytale.server.worldgen.util.condition.BlockMaskCondition;
class="kw">import java.util.Arrays;
class="kw">import java.util.Objects;
class="kw">import java.util.Random;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector2i;
class="kw">import org.joml.Vector3d;
class="kw">import org.joml.Vector3i;
class="kw">public class UniquePrefabContainer {
class="kw">protected class="kw">final int seedOffset;
class="kw">protected class="kw">final UniquePrefabGenerator[] generators;
class="kw">public UniquePrefabContainer(int var1, UniquePrefabGenerator[] var2) {
this.seedOffset = var1;
this.generators = var2;
}
class="kw">public UniquePrefabGenerator[] getGenerators() {
class="kw">return this.generators;
}
@Nonnull
class="kw">public UniquePrefabContainer.UniquePrefabEntry[] generate(int var1, @Nullable Vector2i var2, @Nonnull ChunkGenerator var3) {
Random var4 = new FastRandom(var1 + this.seedOffset);
UniquePrefabContainer.UniquePrefabEntry[] var5 = new UniquePrefabContainer.UniquePrefabEntry[this.generators.length];
for (int var6 = 0; var6 < this.generators.length; var6++) {
UniquePrefabGenerator var7 = this.generators[var6];
UniquePrefabConfiguration var8 = var7.getConfiguration();
Vector3i var9 = var7.generate(var1, var2, var3, var4, var8.getMaxAttempts(), var5);
var5[var6] = new UniquePrefabContainer.UniquePrefabEntry(
var7.getName(),
var7.getCategory(),
var9,
var7.generatePrefab(var4),
var8.getPlacementConfiguration(),
var8.getRotation(var4),
var8.getSpawnOffset(),
var8.getEnvironmentId(),
var8.isFitHeightmap(),
var8.isSubmerge(),
var8.getExclusionRadiusSquared(),
var8.isSpawnLocation(),
var8.isShowOnMap()
);
}
class="kw">return var5;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "UniquePrefabContainer{seedOffset=" + this.seedOffset + ", generators=" + Arrays.toString(this.generators) + "}";
}
class="kw">public class="kw">static class UniquePrefabEntry {
class="kw">protected class="kw">final String name;
class="kw">protected class="kw">final PrefabCategory category;
@Nonnull
class="kw">protected class="kw">final Vector3i position;
@Nonnull
class="kw">protected class="kw">final WorldGenPrefabSupplier prefabSupplier;
class="kw">protected class="kw">final BlockMaskCondition configuration;
@Nonnull
class="kw">protected class="kw">final PrefabRotation rotation;
class="kw">protected class="kw">final Vector3d spawnOffset;
class="kw">protected class="kw">final int lowBoundX;
class="kw">protected class="kw">final int lowBoundY;
class="kw">protected class="kw">final int lowBoundZ;
class="kw">protected class="kw">final int highBoundX;
class="kw">protected class="kw">final int highBoundY;
class="kw">protected class="kw">final int highBoundZ;
class="kw">protected class="kw">final int environmentId;
class="kw">protected class="kw">final boolean fitHeightmap;
class="kw">protected class="kw">final boolean submerge;
class="kw">protected class="kw">final double exclusionRadiusSquared;
class="kw">protected class="kw">final boolean spawnLocation;
class="kw">protected class="kw">final boolean showOnMap;
class="kw">private UniquePrefabEntry(
String var1,
@Nonnull PrefabCategory var2,
@Nonnull Vector3i var3,
@Nonnull WorldGenPrefabSupplier var4,
BlockMaskCondition var5,
@Nonnull PrefabRotation var6,
Vector3d var7,
int var8,
boolean var9,
boolean var10,
double var11,
boolean var13,
boolean var14
) {
this.name = var1;
this.category = var2;
this.position = var3;
this.prefabSupplier = var4;
this.configuration = var5;
this.rotation = var6;
this.spawnOffset = var7;
this.environmentId = var8;
this.fitHeightmap = var9;
this.submerge = var10;
this.exclusionRadiusSquared = var11;
this.spawnLocation = var13;
this.showOnMap = var14;
IPrefabBuffer var15 = Objects.requireNonNull(var4.get());
IChunkBounds var16 = var4.getBounds(var15);
this.lowBoundY = var3.y + var15.getMinY();
this.highBoundY = var3.y + var15.getMaxY();
this.lowBoundX = var3.x + var16.getLowBoundX(var6);
this.lowBoundZ = var3.z + var16.getLowBoundZ(var6);
this.highBoundX = var3.x + var16.getHighBoundX(var6);
this.highBoundZ = var3.z + var16.getHighBoundZ(var6);
}
class="kw">public String getName() {
class="kw">return this.name;
}
@Nonnull
class="kw">public PrefabCategory getCategory() {
class="kw">return this.category;
}
@Nonnull
class="kw">public Vector3i getPosition() {
class="kw">return this.position;
}
@Nonnull
class="kw">public WorldGenPrefabSupplier getPrefabSupplier() {
class="kw">return this.prefabSupplier;
}
class="kw">public BlockMaskCondition getConfiguration() {
class="kw">return this.configuration;
}
@Nonnull
class="kw">public PrefabRotation getRotation() {
class="kw">return this.rotation;
}
class="kw">public Vector3d getSpawnOffset() {
class="kw">return this.spawnOffset;
}
class="kw">public int getLowBoundX() {
class="kw">return this.lowBoundX;
}
class="kw">public int getLowBoundY() {
class="kw">return this.lowBoundY;
}
class="kw">public int getLowBoundZ() {
class="kw">return this.lowBoundZ;
}
class="kw">public int getHighBoundX() {
class="kw">return this.highBoundX;
}
class="kw">public int getHighBoundY() {
class="kw">return this.highBoundY;
}
class="kw">public int getHighBoundZ() {
class="kw">return this.highBoundZ;
}
class="kw">public int getEnvironmentId() {
class="kw">return this.environmentId;
}
class="kw">public boolean isFitHeightmap() {
class="kw">return this.fitHeightmap;
}
class="kw">public boolean isSubmerge() {
class="kw">return this.submerge;
}
class="kw">public double getExclusionRadiusSquared() {
class="kw">return this.exclusionRadiusSquared;
}
class="kw">public boolean isSpawnLocation() {
class="kw">return this.spawnLocation;
}
class="kw">public boolean isShowOnMap() {
class="kw">return this.showOnMap;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "UniquePrefabEntry{position="
+ this.position
+ ", prefabSupplier="
+ this.prefabSupplier
+ ", configuration="
+ this.configuration
+ ", rotation="
+ this.rotation
+ ", lowBoundX="
+ this.lowBoundX
+ ", lowBoundZ="
+ this.lowBoundZ
+ ", highBoundX="
+ this.highBoundX
+ ", highBoundZ="
+ this.highBoundZ
+ ", fitHeightmap="
+ this.fitHeightmap
+ ", submerge="
+ this.submerge
+ ", exclusionRadiusSquared="
+ this.exclusionRadiusSquared
+ ", spawnLocation="
+ this.spawnLocation
+ "}";
}
}
}