java.lang.Object
org.cyclops.cyclopscore.infobook.pageelement.RewardItem
All Implemented Interfaces:
IReward

public class RewardItem extends Object implements IReward
An item reward.
  • Field Details

  • Constructor Details

    • RewardItem

      public RewardItem(net.minecraft.world.item.ItemStack itemStack)
  • Method Details

    • canObtain

      public boolean canObtain(net.minecraft.world.entity.player.Player player)
      Description copied from interface: IReward
      If the given player in its current state is able to obtain this reward.
      Specified by:
      canObtain in interface IReward
      Parameters:
      player - The player.
      Returns:
      If it can obtain this.
    • obtain

      public void obtain(net.minecraft.world.entity.player.Player player)
      Description copied from interface: IReward
      The logic for obtaining this reward. Will only be called server-side.
      Specified by:
      obtain in interface IReward
      Parameters:
      player - The player.
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface IReward
      Returns:
      The gui width/
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface IReward
      Returns:
      The gui height.
    • createButton

      public AdvancedButton createButton(IInfoBook infoBook)
      Specified by:
      createButton in interface IReward
      Parameters:
      infoBook - The infobook instance.
      Returns:
      Factory for a button for this reward.
    • drawElementInner

      public void drawElementInner(ScreenInfoBook gui, net.minecraft.client.gui.GuiGraphics guiGraphics, int x, int y, int width, int height, int page, int mx, int my, AdvancedButton button)
      Description copied from interface: IReward
      Draw the reward.
      Specified by:
      drawElementInner in interface IReward
      Parameters:
      gui - The gui.
      guiGraphics - The gui graphics object.
      x - Start X.
      y - Start Y.
      width - Max width.
      height - Max height.
      page - Current page.
      mx - Mouse X.
      my - Mouse Y.
      button - The button of this reward.