Package dev.lone.itemsadder.api
Class CustomCrop
java.lang.Object
dev.lone.itemsadder.api.CustomCrop
Class representing a custom crop in ItemsAdder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable CustomCropbyAlreadyPlaced(org.bukkit.block.Block block) Gets a CustomCrop instance through the provided block.intgetAge()Gets the current age of this CustomCrop.@Nullable List<org.bukkit.inventory.ItemStack>getLoot()@Nullable List<org.bukkit.inventory.ItemStack>getLoot(@Nullable org.bukkit.inventory.ItemStack toolUsed) static @Nullable List<org.bukkit.inventory.ItemStack>getLoot(org.bukkit.block.Block block) static @Nullable List<org.bukkit.inventory.ItemStack>getLoot(org.bukkit.block.Block block, @Nullable org.bukkit.inventory.ItemStack toolUsed) intGets the maximum age of this CustomCrop.getSeed()Gets aCustomStackinstance of the Seeds associated with this CustomCrop.voidIncrements the current age of this CustomCrop by one.booleanReturns whether this CustomCrop is fully grown or not.static booleanisSeed(org.bukkit.inventory.ItemStack itemStack) static @Nullable CustomCropPlaces a CustomCrop at the provided location and return the CustomCrop instance for it.voidsetAge(int age) Sets the age of this CustomCrop to the provided one.voidSets the growth-stage of this CustomCrop to fully grown.
-
Constructor Details
-
CustomCrop
public CustomCrop()
-
-
Method Details
-
place
@Nullable public static @Nullable CustomCrop place(String seed_namespacedId, org.bukkit.Location location) Places a CustomCrop at the provided location and return the CustomCrop instance for it.
May return null if the Namespace and ID are invalid.- Parameters:
seed_namespacedId- Namespace and ID in the formatnamespace:idlocation- The location to place the CustomCrop at.- Returns:
- Possibly-null CustomCrop instance.
-
byAlreadyPlaced
Gets a CustomCrop instance through the provided block.
This may return null if the provided block is not a CustomCrop.- Parameters:
block- The block to get a CustomCrop instance from.- Returns:
- Possibly-null CustomCrop instance.
-
isSeed
public static boolean isSeed(org.bukkit.inventory.ItemStack itemStack) -
getLoot
@Nullable public static @Nullable List<org.bukkit.inventory.ItemStack> getLoot(org.bukkit.block.Block block, @Nullable @Nullable org.bukkit.inventory.ItemStack toolUsed) -
getLoot
@Nullable public static @Nullable List<org.bukkit.inventory.ItemStack> getLoot(org.bukkit.block.Block block) -
getSeed
Gets aCustomStackinstance of the Seeds associated with this CustomCrop.- Returns:
CustomStackrepresenting the seeds for this CustomCrop.
-
getLoot
@Nullable public @Nullable List<org.bukkit.inventory.ItemStack> getLoot(@Nullable @Nullable org.bukkit.inventory.ItemStack toolUsed) -
getLoot
-
getAge
public int getAge()Gets the current age of this CustomCrop.- Returns:
- Integer representing the current age of the CustomCrop.
-
setAge
public void setAge(int age) Sets the age of this CustomCrop to the provided one.- Parameters:
age- the age to set for this CustomCrop.
-
isFullyGrown
public boolean isFullyGrown()Returns whether this CustomCrop is fully grown or not.- Returns:
- true if the CustomCrop is fully grown, otherwise false.
-
getMaxAge
public int getMaxAge()Gets the maximum age of this CustomCrop.- Returns:
- Integer representing the maximum age of the CustomCrop.
-
setFullyGrown
public void setFullyGrown()Sets the growth-stage of this CustomCrop to fully grown. -
incrementAge
public void incrementAge()Increments the current age of this CustomCrop by one.
-