Class LocationCheckCondition
java.lang.Object
com.github.darksoulq.abyssallib.world.data.loot.LootCondition
com.github.darksoulq.abyssallib.world.data.loot.condition.LocationCheckCondition
A loot condition that evaluates to true if the loot generation occurs within specific biomes.
This condition allows for biome-specific loot tables, enabling different drops based on the geographical location of the event in the game world.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<LocationCheckCondition> The codec used for serializing and deserializing the location check condition.static final LootConditionType<LocationCheckCondition> The registered type definition for the location check loot condition. -
Constructor Summary
ConstructorsConstructorDescriptionLocationCheckCondition(List<String> biomes) Constructs a new LocationCheckCondition with a list of allowed biomes. -
Method Summary
Modifier and TypeMethodDescriptiongetType()Retrieves the specific type definition for this loot condition.booleantest(LootContext context) Tests whether the biome at the context's location is present in the allowed list.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the location check condition.It maps the "biomes" field, which expects a list of namespaced strings representing valid biomes for this condition.
-
TYPE
The registered type definition for the location check loot condition.
-
-
Constructor Details
-
LocationCheckCondition
-
-
Method Details
-
test
Tests whether the biome at the context's location is present in the allowed list.This method retrieves the
Biomeat the generation coordinates and uses theRegistryAccessAPI to resolve itsNamespacedKeyfor comparison.- Specified by:
testin classLootCondition- Parameters:
context- TheLootContextproviding the world coordinates.- Returns:
trueif the current biome is in the list;falseotherwise.
-
getType
Retrieves the specific type definition for this loot condition.- Specified by:
getTypein classLootCondition- Returns:
- The
LootConditionTypeassociated withLocationCheckCondition.
-