Class RewardItem
java.lang.Object
org.cyclops.cyclopscore.infobook.pageelement.RewardItem
- All Implemented Interfaces:
IReward
An item reward.
-
Field Summary
-
Constructor Summary
-
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.
-
Field Details
-
SLOT_SIZE
protected static final int SLOT_SIZE- See Also:
-
-
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. -
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. -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
createButton
- Specified by:
createButton
in interfaceIReward
- 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 interfaceIReward
- 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.
-