Class CriterionListeners<T extends net.minecraft.advancements.CriterionTriggerInstance>
java.lang.Object
com.minecolonies.api.advancements.CriterionListeners<T>
- Type Parameters:
T- the Instance of the criterion that will be tested against
- Direct Known Subclasses:
ArmyPopulationListeners,BuildingAddRecipeListeners,CitizenEatFoodListeners,ClickGuiButtonListeners,ColonyPopulationListeners,CompleteBuildRequestListeners,CreateBuildRequestListeners,OpenGuiWindowListeners,PlaceStructureListeners,PlaceSupplyListeners
public class CriterionListeners<T extends net.minecraft.advancements.CriterionTriggerInstance>
extends Object
A base class for the listening manager of a given criterion that captures and tests
and checks each advancement when the criterion is triggered
-
Constructor Summary
ConstructorsConstructorDescriptionCriterionListeners(net.minecraft.server.PlayerAdvancements playerAdvancements) The base manager for the listeners, where each listener is an advancement that could be triggered by the associated criterion -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a new criterion listenerbooleanisEmpty()voidremove an existing criterion listenervoidtrigger()Grants advancements with no conditions or checks (for simple checks to be made in events)voidGrants each advancement that passes the test provided by that advancement's listener.
-
Constructor Details
-
CriterionListeners
public CriterionListeners(net.minecraft.server.PlayerAdvancements playerAdvancements) The base manager for the listeners, where each listener is an advancement that could be triggered by the associated criterion- Parameters:
playerAdvancements- the advancements associated with the player
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
add
add a new criterion listener -
remove
remove an existing criterion listener -
trigger
public void trigger()Grants advancements with no conditions or checks (for simple checks to be made in events) -
trigger
Grants each advancement that passes the test provided by that advancement's listener.- Parameters:
test- the test to return true if the advancement is to be granted
-