Class ActionAddTrade

All Implemented Interfaces:
IAction, IRuntimeAction, IUndoableAction

public class ActionAddTrade extends ActionTradeBase
  • Constructor Details

    • ActionAddTrade

      public ActionAddTrade(net.minecraft.world.entity.npc.VillagerProfession profession, int level, net.minecraft.world.entity.npc.VillagerTrades.ItemListing trade)
  • Method Details

    • apply

      public void apply()
      Description copied from interface: IAction
      Applies the action, executing all code necessary.
    • apply

      public void apply(List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> tradeList)
      Specified by:
      apply in class ActionTradeBase
    • describe

      public String describe()
      Description copied from interface: IAction
      Gets a human-readable description of the action.

      This message is used for logging and to surface information to the user when something goes wrong. It is thus customary to describe the action as accurately as possible without being too verbose.

      It is not allowed to return a null or otherwise empty description for the action: doing so will raise an error at runtime.

      Returns:
      A description of the current action.
    • undo

      public void undo()
      Description copied from interface: IUndoableAction
      Undoes all changes carried out by the action.
    • undo

      public void undo(List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> tradeList)
      Specified by:
      undo in class ActionTradeBase
    • describeUndo

      public String describeUndo()
      Description copied from interface: IUndoableAction
      Gets a human-readable description of the action rollback.

      This message is used for logging and to surface information to the user when something goes wrong. It is thus customary to describe the rollback as accurately as possible without being too verbose.

      It is not allowed to return a null or otherwise empty description for the rollback: doing so will raise an error at runtime.

      Returns:
      A description of the current action rollback.