Class CustomFire
java.lang.Object
dev.lone.itemsadder.api.CustomStack
dev.lone.itemsadder.api.CustomFire
Wrapper for a custom fire item and its placed fire block.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable CustomFirebyAlreadyPlaced(Block block) Gets the custom fire wrapper for an already placed fire block.static @Nullable CustomFirebyItemStack(ItemStack itemStack) Gets a custom fire wrapper from an item stack.intgetAge()Gets the age of this placed custom fire.static intGets the age of a fire block.static @Nullable CustomFiregetInstance(String namespacedID) Gets a clone of the custom fire item declared in the ItemsAdder registry.@Nullable LocationGets the placed fire location.booleanisPlaced()Checks if this wrapper is associated with a placed block.static @Nullable CustomFirePlaces custom fire in the world.Places this custom fire in the world.booleanremove()Removes this custom fire from the world.static booleanRemoves custom fire at the provided location.voidsetAge(int age) Sets the age of this placed custom fire.static voidSets the age of a fire block.Methods inherited from class CustomStack
drop, getConfig, getConfigPath, getConfigSectionCopy, getConfigSectionCopy, getConfigSectionCopy, getConfigSectionCopy, getCooldownMs, getDamageMainhand, getDisplayName, getDurability, getId, getItemStack, getMaxDurability, getModelPath, getNamespace, getNamespacedID, getNamespacedIdsInRegistry, getPermission, getRequiredStats, getTextures, getUsages, hasAutoGeneratedModel, hasCooldown, hasCustomDurability, hasPermission, hasUsagesAttribute, isBlock, isBlock, isBlockAllEnchants, isComplexFurniture, isFurniture, isFurnitureConsumable, isFurnitureSittable, isFurnitureTradeMachine, isInRegistry, isVehicle, itemName, matchNamespacedID, openTradeMenu, reduceUsages, requiresStats, setAttributeModifier, setDisplayName, setDurability, setMaxDurability, setUsages, updateAttackDamageLore, updateAttackSpeedLore
-
Method Details
-
getInstance
Gets a clone of the custom fire item declared in the ItemsAdder registry.- Parameters:
namespacedID- the custom fire namespaced id.- Returns:
- the custom fire wrapper, or null if it does not exist.
-
byItemStack
Gets a custom fire wrapper from an item stack.- Parameters:
itemStack- the item stack to read.- Returns:
- the custom fire wrapper, or null if the item is not custom fire.
-
place
Places custom fire in the world.- Parameters:
namespacedId- the custom fire namespaced id.location- the location where the fire will be placed.- Returns:
- the placed custom fire wrapper, or null if the item does not exist.
-
byAlreadyPlaced
Gets the custom fire wrapper for an already placed fire block.- Parameters:
block- the fire block.- Returns:
- the custom fire wrapper, or null if the block is not custom fire.
-
remove
Removes custom fire at the provided location.- Parameters:
location- the custom fire location.- Returns:
- true when the custom fire data is removed.
-
getAge
Gets the age of a fire block.- Parameters:
block- the fire block.- Returns:
- the fire age.
- Throws:
ClassCastException- if the block is not fire.
-
setAge
Sets the age of a fire block.- Parameters:
block- the fire block.age- the new fire age.- Throws:
ClassCastException- if the block is not fire.
-
getLocation
Gets the placed fire location.- Returns:
- the fire location, or null if this wrapper is not placed.
-
isPlaced
public boolean isPlaced()Checks if this wrapper is associated with a placed block.- Returns:
- true if this custom fire is placed.
-
place
Places this custom fire in the world.- Parameters:
location- the location where the fire will be placed.- Returns:
- this wrapper.
-
remove
public boolean remove()Removes this custom fire from the world.- Returns:
- true if the custom fire was removed.
-
getAge
public int getAge()Gets the age of this placed custom fire.- Returns:
- the fire age.
-
setAge
public void setAge(int age) Sets the age of this placed custom fire.- Parameters:
age- the new fire age.
-