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
    • Method Summary

      Modifier and Type Method Description
      final static Array<String> furnitureIDs() Get all NexoItem IDs that have a FurnitureMechanic
      final static Boolean isFurniture(Location location) Check if a location contains a Furniture
      final static Boolean isFurniture(String itemID) Check if an itemID has a FurnitureMechanic
      final static Boolean isFurniture(ItemStack itemStack)
      final static Boolean isFurniture(Entity entity)
      final static ItemDisplay baseEntity(Block block)
      final static ItemDisplay baseEntity(Location location)
      final static ItemDisplay baseEntity(Integer interactionId)
      final static ItemDisplay place(String itemID, Location location, Rotation rotation, BlockFace blockFace) Places Furniture at a given location
      final static ItemDisplay place(String itemID, Location location, Float yaw, BlockFace blockFace) Places Furniture at a given location
      final static Boolean remove(Location location, Player player, Drop drop) Removes Furniture at a given location, optionally by a player
      final static Boolean remove(Location location, Player player) Removes Furniture at a given location, optionally by a player
      final static Boolean remove(Location location) Removes Furniture at a given location, optionally by a player
      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
      final static Boolean remove(Entity baseEntity, Player player) Removes Furniture at a given Entity, optionally by a player and with an altered Drop
      final static Boolean remove(Entity baseEntity) Removes Furniture at a given Entity, optionally by a player and with an altered Drop
      final static FurnitureMechanic furnitureMechanic(Block block)
      final static FurnitureMechanic furnitureMechanic(Location location) Get the FurnitureMechanic from a given location.
      final static FurnitureMechanic furnitureMechanic(Entity baseEntity) Get the FurnitureMechanic from a given entity.
      final static FurnitureMechanic furnitureMechanic(String itemID) Get the FurnitureMechanic from a given block.
      final static Unit updateFurniture(ItemDisplay baseEntity) Ensures that the given entity is a Furniture, and updates it if it is
      final static Unit convertFurniture(ItemDisplay baseEntity)
      final static ItemDisplay findTargetFurniture(Player player)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • 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