Class CustomFurniture
java.lang.Object
dev.lone.itemsadder.api.CustomStack
dev.lone.itemsadder.api.CustomFurniture
Wrapper for simple ItemsAdder furniture spawned in the world.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable CustomFurniturebyAlreadySpawned(Block block) Gets a furniture wrapper from a block occupied by a furniture entity.static @Nullable CustomFurniturebyAlreadySpawned(Entity entity) Gets a furniture wrapper from an already spawned furniture entity.@Nullable EntityDeprecated.@Nullable EntityGet the armorstandGets all furniture namespaced ids currently registered.intGets the light level configured for this furniture.voidremove(boolean dropItem) Removes this furniture from the world.static voidRemoves a furniture entity from the world.voidreplaceFurniture(String newFurnitureNamespacedId) Replaces this furniture with another furniture item.voidreplaceFurniture(String newFurnitureNamespacedId, Color color) Replaces this furniture with another furniture item and applies a color.voidSets the displayed item color when the furniture item supports it.voidsetCurrentLightLevel(int level) Sets the current light level emitted by this furniture.static @Nullable CustomFurnitureSpawns furniture at a block location.static @Nullable CustomFurniturespawnPreciseNonSolid(String namespacedId, Location location) Spawns non-solid furniture at an exact location.voidTeleports this furniture to another entity location.voidTeleports this furniture to a location.Methods inherited from class CustomStack
byItemStack, drop, getConfig, getConfigPath, getConfigSectionCopy, getConfigSectionCopy, getConfigSectionCopy, getConfigSectionCopy, getCooldownMs, getDamageMainhand, getDisplayName, getDurability, getId, getInstance, getItemStack, getMaxDurability, getModelPath, getNamespace, getNamespacedID, 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
-
getNamespacedIdsInRegistry
-
byAlreadySpawned
Gets a furniture wrapper from an already spawned furniture entity.- Parameters:
entity- the Bukkit entity used by the furniture.- Returns:
- the furniture wrapper, or null if the entity is not furniture.
-
byAlreadySpawned
Gets a furniture wrapper from a block occupied by a furniture entity.- Parameters:
block- the block to check.- Returns:
- the furniture wrapper, or null if no furniture is found.
-
spawnPreciseNonSolid
@Nullable public static @Nullable CustomFurniture spawnPreciseNonSolid(String namespacedId, Location location) Spawns non-solid furniture at an exact location.- Parameters:
namespacedId- the furniture namespaced id.location- the exact spawn location.- Returns:
- the spawned furniture wrapper, or null if the furniture does not exist.
-
spawn
Spawns furniture at a block location.- Parameters:
namespacedId- the furniture namespaced id.blockLocation- the target block.- Returns:
- the spawned furniture wrapper, or null if the furniture does not exist.
-
remove
public void remove(boolean dropItem) Removes this furniture from the world.- Parameters:
dropItem- true to drop the furniture item.
-
remove
Removes a furniture entity from the world.- Parameters:
entity- the furniture entity.dropItem- true to drop the furniture item.
-
teleport
Teleports this furniture to another entity location.- Parameters:
destinationEntity- the destination entity.
-
teleport
Teleports this furniture to a location.- Parameters:
location- the destination location.
-
replaceFurniture
Replaces this furniture with another furniture item.- Parameters:
newFurnitureNamespacedId- the new furniture namespaced id.
-
replaceFurniture
-
setColor
Sets the displayed item color when the furniture item supports it.- Parameters:
color- the color to apply.
-
getOriginalLightLevel
public int getOriginalLightLevel()Gets the light level configured for this furniture.- Returns:
- the configured light level.
-
setCurrentLightLevel
public void setCurrentLightLevel(int level) Sets the current light level emitted by this furniture.- Parameters:
level- the new light level.
-
getArmorstand
Deprecated.usegetEntity()instead.Gets the Armor stand associated with this CustomFurniture.
This may return null if the Armor stand is not yet spawned in the world.- Returns:
- Possibly-null Bukkit Entity instance.
-
getEntity
Get the armorstand- Returns:
- null if it's not spawned in world
-
getEntity()instead.