Class OpenGuiWindowCriterionInstance

java.lang.Object
net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
com.minecolonies.api.advancements.open_gui_window.OpenGuiWindowCriterionInstance
All Implemented Interfaces:
net.minecraft.advancements.CriterionTriggerInstance

public class OpenGuiWindowCriterionInstance extends net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance
The test instance to check the "window_resource_location" for the "open_gui_window" trigger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    OpenGuiWindowCriterionInstance(net.minecraft.resources.ResourceLocation windowResource)
    Construct the check with a single condition
  • Method Summary

    Modifier and Type
    Method
    Description
    deserializeFromJson(@NotNull com.google.gson.JsonObject jsonObject, @NotNull net.minecraft.advancements.critereon.DeserializationContext context)
     
    @NotNull com.google.gson.JsonObject
    serializeToJson(@NotNull net.minecraft.advancements.critereon.SerializationContext context)
     
    boolean
    test(net.minecraft.resources.ResourceLocation windowResource)
    Performs the check for the conditions

    Methods inherited from class net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance

    getCriterion, getPlayerPredicate, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OpenGuiWindowCriterionInstance

      public OpenGuiWindowCriterionInstance()
    • OpenGuiWindowCriterionInstance

      public OpenGuiWindowCriterionInstance(net.minecraft.resources.ResourceLocation windowResource)
      Construct the check with a single condition
      Parameters:
      windowResource - the window that has to be opened to succeed
  • Method Details

    • test

      public boolean test(net.minecraft.resources.ResourceLocation windowResource)
      Performs the check for the conditions
      Parameters:
      windowResource - the blockui window id that was just opened
      Returns:
      whether the check succeeded
    • deserializeFromJson

      @NotNull public static @NotNull OpenGuiWindowCriterionInstance deserializeFromJson(@NotNull @NotNull com.google.gson.JsonObject jsonObject, @NotNull @NotNull net.minecraft.advancements.critereon.DeserializationContext context)
    • serializeToJson

      @NotNull public @NotNull com.google.gson.JsonObject serializeToJson(@NotNull @NotNull net.minecraft.advancements.critereon.SerializationContext context)
      Specified by:
      serializeToJson in interface net.minecraft.advancements.CriterionTriggerInstance
      Overrides:
      serializeToJson in class net.minecraft.advancements.critereon.AbstractCriterionTriggerInstance