Class CustomComplexFurniture
java.lang.Object
dev.lone.itemsadder.api.CustomComplexFurniture
Wrapper for complex furniture backed by a custom entity renderer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable CustomComplexFurniturebyAlreadySpawned(Block block) Gets a complex furniture wrapper from a block occupied by a complex furniture entity.static @Nullable CustomComplexFurniturebyAlreadySpawned(LivingEntity entity) Gets a complex furniture wrapper from an already spawned base entity.Get the Bukkit base entity for this custom complex furniture.Gets all complex furniture namespaced ids currently registered.@Nullable BooleanGets whether this complex furniture is configured as solid.@Nullable IntegerGets the light level configured for this complex furniture.voidremove(boolean dropItem) Removes this complex furniture from the world.static voidremove(LivingEntity entity, boolean dropItem) Removes a complex furniture entity from the world.voidApplies a color to all bones of the complex furniture renderer.voidsetCurrentLightLevel(int level) Sets the current light level emitted by this complex furniture.static @Nullable CustomComplexFurnitureSpawns complex furniture in the world.voidTeleports this complex furniture to another entity location.voidTeleports this complex furniture to a location.
-
Constructor Details
-
CustomComplexFurniture
public CustomComplexFurniture()
-
-
Method Details
-
getNamespacedIdsInRegistry
-
byAlreadySpawned
Gets a complex furniture wrapper from an already spawned base entity.- Parameters:
entity- the Bukkit base entity.- Returns:
- the complex furniture wrapper, or null if the entity is not complex furniture.
-
byAlreadySpawned
Gets a complex furniture wrapper from a block occupied by a complex furniture entity.- Parameters:
block- the block to check.- Returns:
- the complex furniture wrapper, or null if no complex furniture is found.
-
spawn
@Nullable public static @Nullable CustomComplexFurniture spawn(String namespacedId, Location location, BlockFace blockFace, boolean forceNonSolid) Spawns complex furniture in the world.- Parameters:
namespacedId- the complex furniture namespaced id.location- the spawn location.blockFace- the placement direction.forceNonSolid- true to place it as non-solid.- Returns:
- the spawned complex furniture wrapper, or null if it cannot be spawned.
-
remove
public void remove(boolean dropItem) Removes this complex furniture from the world.- Parameters:
dropItem- true to drop the furniture item.
-
remove
Removes a complex furniture entity from the world.- Parameters:
entity- the base entity of the complex furniture.dropItem- true to drop the furniture item.
-
teleport
Teleports this complex furniture to another entity location.- Parameters:
destinationEntity- the destination entity.
-
teleport
Teleports this complex furniture to a location.- Parameters:
location- the destination location.
-
setColor
Applies a color to all bones of the complex furniture renderer.- Parameters:
color- the color to apply.
-
getOriginalLightLevel
Gets the light level configured for this complex furniture.- Returns:
- the configured light level, or null if not configured.
-
getOriginalIsSolid
Gets whether this complex furniture is configured as solid.- Returns:
- true if solid, false if non-solid, or null if not configured.
-
setCurrentLightLevel
public void setCurrentLightLevel(int level) Sets the current light level emitted by this complex furniture.- Parameters:
level- the new light level.
-
getEntity
Get the Bukkit base entity for this custom complex furniture.- Returns:
- null if it's not spawned in world
-