classpublicPriority 3
PrefabWeights
com.hypixel.hytale.server.core.prefab.PrefabWeights
12
Methods
12
Public Methods
5
Fields
2
Constructors
Constants
charASSIGNMENT_CHAR= '='
Codec<PrefabWeights>CODEC= BuilderCodec.builder(PrefabWeights.class, PrefabWeights::new)
.append(new KeyedCodec<>("Def...
doubleDEFAULT_WEIGHT= 1.0
charDELIMITER_CHAR= ','
Codec<Object2DoubleMap<String>>MAP_CODEC= new Object2DoubleMapCodec<>(Codec.STRING, MAP_SUPPLIER, false)
Supplier<Object2DoubleMap<String>>MAP_SUPPLIER= Object2DoubleOpenHashMap::new
PrefabWeightsNONE= <complex>
Constructors
private
PrefabWeights(Object2DoubleMap<String> weights)public
PrefabWeights()Methods
Public Methods (12)
public
void accept(Object2DoubleMap<String> stringObject2DoubleMap, ValidationResults results)public
Set<Entry<String>> entrySet()public
<T> T get(T[] elements, Function<T, String> nameFunc, Random random)@Nullable
public
<T> T get(T[] elements, Function<T, String> nameFunc, double value)@Nullable
public
double getDefaultWeight()public
String getMappingString()@Nonnull
public
double getWeight(String prefab)public
void removeWeight(String prefab)public
void setDefaultWeight(double defaultWeight)public
void setWeight(String prefab, double weight)public
int size()public
String toString()@Nonnull@Override
Fields
Protected Fields (3)
protected
volatile boolean initializedprotected
double sumprotected
double[] weightsPrivate/Package Fields (2)
private
double defaultWeightprivate
Object2DoubleMap<String> weightsLookup