Object NexoFurniture
-
- All Implemented Interfaces:
public class NexoFurniture
-
-
Field Summary
Fields Modifier and Type Field Description public final static NexoFurnitureINSTANCE
-
Method Summary
Modifier and Type Method Description final static Array<String>furnitureIDs()Get all NexoItem IDs that have a FurnitureMechanic final static BooleanisFurniture(Location location)Check if a location contains a Furniture final static BooleanisFurniture(String itemID)Check if an itemID has a FurnitureMechanic final static BooleanisFurniture(ItemStack itemStack)final static BooleanisFurniture(Entity entity)final static ItemDisplaybaseEntity(Block block)final static ItemDisplaybaseEntity(Location location)final static ItemDisplaybaseEntity(Integer interactionId)final static ItemDisplayplace(String itemID, Location location, Rotation rotation, BlockFace blockFace)Places Furniture at a given location final static ItemDisplayplace(String itemID, Location location, Float yaw, BlockFace blockFace)Places Furniture at a given location final static Booleanremove(Location location, Player player, Drop drop)Removes Furniture at a given location, optionally by a player final static Booleanremove(Location location, Player player)Removes Furniture at a given location, optionally by a player final static Booleanremove(Location location)Removes Furniture at a given location, optionally by a player final static Booleanremove(Entity baseEntity, Player player, Drop drop)Removes Furniture at a given Entity, optionally by a player and with an altered Drop final static Booleanremove(Entity baseEntity, Player player)Removes Furniture at a given Entity, optionally by a player and with an altered Drop final static Booleanremove(Entity baseEntity)Removes Furniture at a given Entity, optionally by a player and with an altered Drop final static FurnitureMechanicfurnitureMechanic(Block block)final static FurnitureMechanicfurnitureMechanic(Location location)Get the FurnitureMechanic from a given location. final static FurnitureMechanicfurnitureMechanic(Entity baseEntity)Get the FurnitureMechanic from a given entity. final static FurnitureMechanicfurnitureMechanic(String itemID)Get the FurnitureMechanic from a given block. final static UnitupdateFurniture(ItemDisplay baseEntity)Ensures that the given entity is a Furniture, and updates it if it is final static UnitconvertFurniture(ItemDisplay baseEntity)final static ItemDisplayfindTargetFurniture(Player player)-
-
Method Detail
-
furnitureIDs
final static Array<String> furnitureIDs()
Get all NexoItem IDs that have a FurnitureMechanic
- Returns:
a Set of all NexoItem IDs that have a FurnitureMechanic
-
isFurniture
final static Boolean isFurniture(Location location)
Check if a location contains a Furniture
- Parameters:
location- The location to check- Returns:
true if the location contains a Furniture, otherwise false
-
isFurniture
final static Boolean isFurniture(String itemID)
Check if an itemID has a FurnitureMechanic
- Parameters:
itemID- The itemID to check- Returns:
true if the itemID has a FurnitureMechanic, otherwise false
-
isFurniture
final static Boolean isFurniture(ItemStack itemStack)
-
isFurniture
final static Boolean isFurniture(Entity entity)
-
baseEntity
final static ItemDisplay baseEntity(Block block)
-
baseEntity
final static ItemDisplay baseEntity(Location location)
-
baseEntity
final static ItemDisplay baseEntity(Integer interactionId)
-
place
final static ItemDisplay place(String itemID, Location location, Rotation rotation, BlockFace blockFace)
Places Furniture at a given location
- Parameters:
itemID- The itemID of the Furniture to placelocation- The location to place the Furniturerotation- The rotation of the FurnitureblockFace- The blockFace of the Furniture- Returns:
The Furniture entity that was placed, or null if the Furniture could not be placed
-
place
final static ItemDisplay place(String itemID, Location location, Float yaw, BlockFace blockFace)
Places Furniture at a given location
- Parameters:
itemID- The itemID of the Furniture to placelocation- The location to place the Furnitureyaw- The yaw of the FurnitureblockFace- The blockFace of the Furniture- Returns:
The Furniture entity that was placed, or null if the Furniture could not be placed
-
remove
@JvmOverloads() final static Boolean remove(Location location, Player player, Drop drop)
Removes Furniture at a given location, optionally by a player
- Parameters:
location- The location to remove the Furnitureplayer- The player who removed the Furniture, can be nulldrop- The drop of the furniture, if null the default drop will be used- Returns:
true if the Furniture was removed, false otherwise
-
remove
@JvmOverloads() final static Boolean remove(Location location, Player player)
Removes Furniture at a given location, optionally by a player
- Parameters:
location- The location to remove the Furnitureplayer- The player who removed the Furniture, can be null- Returns:
true if the Furniture was removed, false otherwise
-
remove
@JvmOverloads() final static Boolean remove(Location location)
Removes Furniture at a given location, optionally by a player
- Parameters:
location- The location to remove the Furniture- Returns:
true if the Furniture was removed, false otherwise
-
remove
@JvmOverloads() final static Boolean remove(Entity baseEntity, Player player, Drop drop)
Removes Furniture at a given Entity, optionally by a player and with an altered Drop
- Parameters:
baseEntity- The entity at which the Furniture should be removedplayer- The player who removed the Furniture, can be nulldrop- The drop of the furniture, if null the default drop will be used- Returns:
true if the Furniture was removed, false otherwise
-
remove
@JvmOverloads() final static Boolean remove(Entity baseEntity, Player player)
Removes Furniture at a given Entity, optionally by a player and with an altered Drop
- Parameters:
baseEntity- The entity at which the Furniture should be removedplayer- The player who removed the Furniture, can be null- Returns:
true if the Furniture was removed, false otherwise
-
remove
@JvmOverloads() final static Boolean remove(Entity baseEntity)
Removes Furniture at a given Entity, optionally by a player and with an altered Drop
- Parameters:
baseEntity- The entity at which the Furniture should be removed- Returns:
true if the Furniture was removed, false otherwise
-
furnitureMechanic
final static FurnitureMechanic furnitureMechanic(Block block)
-
furnitureMechanic
final static FurnitureMechanic furnitureMechanic(Location location)
Get the FurnitureMechanic from a given location. This will only return non-null for furniture with a barrier-hitbox
- Parameters:
location- The location to get the FurnitureMechanic from- Returns:
Instance of this block's FurnitureMechanic, or null if the location is not tied to a Furniture
-
furnitureMechanic
final static FurnitureMechanic furnitureMechanic(Entity baseEntity)
Get the FurnitureMechanic from a given entity.
- Parameters:
baseEntity- The entity to get the FurnitureMechanic from- Returns:
Returns this entity's FurnitureMechanic, or null if the entity is not tied to a Furniture
-
furnitureMechanic
final static FurnitureMechanic furnitureMechanic(String itemID)
Get the FurnitureMechanic from a given block. This will only return non-null for furniture with a barrier-hitbox
- Parameters:
itemID- The itemID tied to this FurnitureMechanic- Returns:
Returns the FurnitureMechanic tied to this itemID, or null if the itemID is not tied to a Furniture
-
updateFurniture
final static Unit updateFurniture(ItemDisplay baseEntity)
Ensures that the given entity is a Furniture, and updates it if it is
- Parameters:
baseEntity- The furniture baseEntity to update
-
convertFurniture
final static Unit convertFurniture(ItemDisplay baseEntity)
-
findTargetFurniture
final static ItemDisplay findTargetFurniture(Player player)
-
-
-
-