Class DroppedItem

  • All Implemented Interfaces:
    Tickable

    public class DroppedItem
    extends StaticEntity
    An item that was dropped from the player's inventory (by the user or programatically)
    • Field Detail

      • PICKUP_DELAY

        private static final double PICKUP_DELAY
        How long it takes for a dropped item to be able to be picked up again after being dropped. This prevents the item from going immediately back into the player's inventory if dropped on it
        See Also:
        Constant Field Values
      • LIFETIME_DELAY

        private static final double LIFETIME_DELAY
        How long it takes for a dropped item to "despawn" after being dropped
        See Also:
        Constant Field Values
      • canPickup

        public boolean canPickup
      • isPlayerOver

        public boolean isPlayerOver
    • Constructor Detail

      • DroppedItem

        public DroppedItem​(ItemStack stack,
                           int x,
                           int y)
    • Method Detail

      • destroy

        private void destroy()
        Removes the dropped item from the current sector's entities, and then kills it
      • pickup

        private boolean pickup()
        Attempt to pickup the dropped item
        Returns:
        Whether or not the dropped item was successfully picked up by the player