Package net.glowstone.block.itemtype
Class ItemFood
java.lang.Object
net.glowstone.block.itemtype.ItemType
net.glowstone.block.itemtype.ItemTimedUsage
net.glowstone.block.itemtype.ItemFood
- Direct Known Subclasses:
ItemChorusFruit
,ItemFishCooked
,ItemFishRaw
,ItemFoodSeeds
,ItemGoldenApple
,ItemMilk
,ItemPoisonousPotato
,ItemRawChicken
,ItemRottenFlesh
,ItemSoup
,ItemSpiderEye
-
Nested Class Summary
Nested classes/interfaces inherited from class net.glowstone.block.itemtype.ItemType
ItemType.Context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
eat
(GlowPlayer player, org.bukkit.inventory.ItemStack item) Player attempts to eat this food.void
endUse
(GlowPlayer player, org.bukkit.inventory.ItemStack item) protected int
getFoodLevel
(org.bukkit.inventory.ItemStack stack) protected float
getSaturation
(org.bukkit.inventory.ItemStack stack) protected boolean
handleEat
(GlowPlayer player, org.bukkit.inventory.ItemStack item) void
startUse
(GlowPlayer player, org.bukkit.inventory.ItemStack item) Methods inherited from class net.glowstone.block.itemtype.ItemTimedUsage
getContext, rightClickAir, rightClickBlock
Methods inherited from class net.glowstone.block.itemtype.ItemType
getMaterial, getMaterials, getMaxStackSize, getPlaceAs, setMaterial, setMaxStackSize, setPlaceAs, setPlaceAs, toString
-
Constructor Details
-
ItemFood
public ItemFood(int foodLevel, float saturation)
-
-
Method Details
-
getFoodLevel
protected int getFoodLevel(org.bukkit.inventory.ItemStack stack) -
getSaturation
protected float getSaturation(org.bukkit.inventory.ItemStack stack) -
handleEat
-
eat
Player attempts to eat this food.- Parameters:
player
- the eating playeritem
- the item stack eaten from- Returns:
- whether food was eaten successfully
-
startUse
- Overrides:
startUse
in classItemTimedUsage
-
endUse
- Overrides:
endUse
in classItemTimedUsage
-