Interface LevelBasedValue
- All Known Implementing Classes:
LevelBasedValue.Clamped
,LevelBasedValue.Constant
,LevelBasedValue.Fraction
,LevelBasedValue.LevelsSquared
,LevelBasedValue.Linear
,LevelBasedValue.Lookup
public interface LevelBasedValue
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
static final record
static final record
static final record
static final record
static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<LevelBasedValue> static final com.mojang.serialization.Codec
<LevelBasedValue> -
Method Summary
Modifier and TypeMethodDescriptionstatic com.mojang.serialization.MapCodec
<? extends LevelBasedValue> bootstrap
(Registry<com.mojang.serialization.MapCodec<? extends LevelBasedValue>> registry) float
calculate
(int level) com.mojang.serialization.MapCodec
<? extends LevelBasedValue> codec()
static LevelBasedValue.Constant
constant
(float value) static LevelBasedValue.Lookup
lookup
(List<Float> values, LevelBasedValue fallback) static LevelBasedValue.Linear
perLevel
(float p_perLevel) static LevelBasedValue.Linear
perLevel
(float base, float perLevelAfterFirst)
-
Field Details
-
DISPATCH_CODEC
-
CODEC
-
-
Method Details
-
bootstrap
static com.mojang.serialization.MapCodec<? extends LevelBasedValue> bootstrap(Registry<com.mojang.serialization.MapCodec<? extends LevelBasedValue>> registry) -
constant
-
perLevel
-
perLevel
-
lookup
-
calculate
float calculate(int level) -
codec
com.mojang.serialization.MapCodec<? extends LevelBasedValue> codec()
-