Object NexoFurniture

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • 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

      • baseEntity

         final static ItemDisplay baseEntity(Block block)
      • baseEntity

         final static ItemDisplay baseEntity(Location location)
      • 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 place
        location - The location to place the Furniture
        rotation - The rotation of the Furniture
        blockFace - 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 place
        location - The location to place the Furniture
        yaw - The yaw of the Furniture
        blockFace - 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 Furniture
        player - The player who removed the Furniture, can be null
        drop - 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 Furniture
        player - 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 removed
        player - The player who removed the Furniture, can be null
        drop - 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 removed
        player - 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(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

      • furnitureItem

         final static ItemStack furnitureItem(ItemDisplay baseEntity)
      • furnitureItem

         final static Unit furnitureItem(ItemDisplay baseEntity, ItemStack itemStack)
      • furnitureDye

         final static <Error class: unknown class> furnitureDye(ItemDisplay baseEntity)
      • furnitureDye

         final static Unit furnitureDye(ItemDisplay baseEntity, Color dyeColor)
      • 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