Class DialogueChoiceEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.dialogue.event.DialogueChoiceEvent

@Deprecated(forRemoval=true, since="9.2.7") public class DialogueChoiceEvent extends net.minecraftforge.eventbus.api.Event
Deprecated, for removal: This API element is subject to removal in a future version.
Use DialogueFactory instead.
Event fired when there was a GUI choice and the server is expected to provide the next action. If DialogueNextActionPacket.DialogueGuiAction.NEW_DIALOGUES or DialogueNextActionPacket.DialogueGuiAction.INSERT_DIALOGUES is returned then there is an assumption that {@link this#newDialogues newDialogues} is both non-null and non-empty.

By default, the response will be to continue with any remaining dialogue that has been queued on the client. If none remains, it behaves the same as a response with DialogueNextActionPacket.DialogueGuiAction.CLOSE.

If dialogue choices were provided with handles during building, explicitly handling this event is unnecessary as the handles will execute automatically.

Since:
November 20, 2017
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Choice
    Deprecated, for removal: This API element is subject to removal in a future version.
    The choice that was selected.
    final net.minecraft.server.level.ServerPlayer
    Deprecated, for removal: This API element is subject to removal in a future version.
    The player who made the dialogue choice.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DialogueChoiceEvent(net.minecraft.server.level.ServerPlayer player, Choice choice)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addDialogue(Dialogue newDialogue)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    reply(boolean insert, Dialogue... dialogues)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Simple shortcut to send dialogues back to the player.
    void
    reply(Dialogue... dialogues)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Simple shortcut to send dialogues back to the player.
    void
    reply(String name, String... texts)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Simple shortcut to send dialogues back to the player.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • player

      public final net.minecraft.server.level.ServerPlayer player
      Deprecated, for removal: This API element is subject to removal in a future version.
      The player who made the dialogue choice.
    • choice

      public final Choice choice
      Deprecated, for removal: This API element is subject to removal in a future version.
      The choice that was selected. This can be identified using its choiceID, NOT by object comparison.
  • Constructor Details

    • DialogueChoiceEvent

      public DialogueChoiceEvent(net.minecraft.server.level.ServerPlayer player, Choice choice)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getAction

      Deprecated, for removal: This API element is subject to removal in a future version.
    • setAction

      public void setAction(DialogueNextActionPacket.DialogueGuiAction action)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addDialogue

      public DialogueChoiceEvent addDialogue(Dialogue newDialogue)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setNewDialogues

      public void setNewDialogues(ArrayList<Dialogue> newDialogues)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getNewDialogues

      public ArrayList<Dialogue> getNewDialogues()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • reply

      public void reply(Dialogue... dialogues)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Simple shortcut to send dialogues back to the player. This will replace all previously planned dialogue. To insert dialogue instead, use the overload {@link this#reply(boolean, Dialogue...) reply(boolean, Dialogue...)}.
    • reply

      public void reply(boolean insert, Dialogue... dialogues)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Simple shortcut to send dialogues back to the player.
      Parameters:
      insert - - Whether or not it should use insertion. If false, this will replace all previous dialogue. if true, this will put the given dialogue at the beginning of the queue.
    • reply

      public void reply(String name, String... texts)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Simple shortcut to send dialogues back to the player.