HyCodeYourTale
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)

protectedvolatile boolean initialized
protecteddouble sum
protecteddouble[] weights

Private/Package Fields (2)

privatedouble defaultWeight
privateObject2DoubleMap<String> weightsLookup

Related Classes