Class GrindstoneEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.GrindstoneEvent
Direct Known Subclasses:
GrindstoneEvent.OnPlaceItem, GrindstoneEvent.OnTakeItem

public abstract class GrindstoneEvent extends net.minecraftforge.eventbus.api.Event
Shared logic for the two events fired from grindstones.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    This event is Cancelable
    GrindstoneEvent.OnPlaceItem is fired when the inputs to a grindstone are changed.
    static class 
    This event is Cancelable.
    GrindstoneEvent.OnTakeItem is fired when the output of a grindstone is taken.

    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
    private final ItemStack
     
    private final ItemStack
     
    private int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    GrindstoneEvent(ItemStack top, ItemStack bottom, int xp)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the item in the bottom input grindstone slot.
    Returns the item in the top input grindstone slot.
    int
    Returns the experience amount given to the player.
    void
    setXp(int xp)
    Sets the experience amount.

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

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

    Methods inherited from class java.lang.Object

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

    • top

      private final ItemStack top
    • bottom

      private final ItemStack bottom
    • xp

      private int xp
  • Constructor Details

  • Method Details

    • getTopItem

      public ItemStack getTopItem()
      Returns the item in the top input grindstone slot.
      Returns:
      the item in the top input grindstone slot
    • getBottomItem

      public ItemStack getBottomItem()
      Returns the item in the bottom input grindstone slot.
      Returns:
      the item in the bottom input grindstone slot
    • getXp

      public int getXp()
      Returns the experience amount given to the player. It will be -1 unless setXp(int) is called.
      Returns:
      the experience amount given to the player
    • setXp

      public void setXp(int xp)
      Sets the experience amount.
      Parameters:
      xp - The experience amount given to the player.