Interface IReward
- All Known Implementing Classes:
RewardItem
public interface IReward
A reward instance.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canObtain
(net.minecraft.world.entity.player.Player player) If the given player in its current state is able to obtain this reward.createButton
(IInfoBook infoBook) 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) Draw the reward.int
int
getWidth()
void
obtain
(net.minecraft.world.entity.player.Player player) The logic for obtaining this reward.
-
Method Details
-
canObtain
boolean canObtain(net.minecraft.world.entity.player.Player player) If the given player in its current state is able to obtain this reward.- Parameters:
player
- The player.- Returns:
- If it can obtain this.
-
obtain
void obtain(net.minecraft.world.entity.player.Player player) The logic for obtaining this reward. Will only be called server-side.- Parameters:
player
- The player.
-
getWidth
int getWidth()- Returns:
- The gui width/
-
getHeight
int getHeight()- Returns:
- The gui height.
-
createButton
- Parameters:
infoBook
- The infobook instance.- Returns:
- Factory for a button for this reward.
-
drawElementInner
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) Draw the reward.- 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.
-