All Implemented Interfaces:
org.kingdoms.abstraction.Levellable, Keyed<SimpleLocation>, SmartObject, org.kingdoms.constants.group.model.logs.Loggable, FuelContainer, org.kingdoms.data.Deserializable, org.kingdoms.data.Serializable, org.kingdoms.locale.provider.CascadingMessageContextProvider, org.kingdoms.locale.provider.MessageContextProvider

public class Extractor extends Structure implements FuelContainer
  • Constructor Details

  • Method Details

    • getLastCollected

      public long getLastCollected()
    • setLastCollected

      public void setLastCollected(long lastCollected)
    • getLastCollector

      public UUID getLastCollector()
    • setLastCollector

      public void setLastCollector(UUID lastCollector)
    • setCollected

      public void setCollected(long collected)
    • getFuel

      public double getFuel()
      Specified by:
      getFuel in interface FuelContainer
    • setFuel

      public void setFuel(double fuel)
      Specified by:
      setFuel in interface FuelContainer
    • getMaxFuel

      public double getMaxFuel()
      Specified by:
      getMaxFuel in interface FuelContainer
    • remove

      public KingdomItemBreakEvent<?> remove(org.kingdoms.events.items.KingdomItemRemoveContext context)
      Overrides:
      remove in class Structure
    • estimateRemaining

      public org.kingdoms.data.Pair<Long,Long> estimateRemaining()
      Estimates the remaining resource points this extractor can generate with the fuel it has left.
      • It considers external fuel sources such as hoppers if possible.
      • It ignores the capcity of the extractor.
      • It ignores the fuel.enabled option.
      Returns:
      The key represents the resource points it can generate and the value represenets the time in ms until it runs out of fuel and
    • getCollectedResourcePoints

      public long getCollectedResourcePoints()
    • getAttachedHoppers

      public CompletableFuture<List<org.bukkit.block.Hopper>> getAttachedHoppers()
    • getTotalFuelFromAttachedHoppers

      public long getTotalFuelFromAttachedHoppers()
    • fillFuelFromAttachedHoppers

      public void fillFuelFromAttachedHoppers()
    • addMessageContextEdits

      @MustBeInvokedByOverriders public MessagePlaceholderProvider addMessageContextEdits(MessagePlaceholderProvider context, Kingdom kingdom)
      Overrides:
      addMessageContextEdits in class Structure
    • getMaxFuel

      public double getMaxFuel(Kingdom kingdom, int level)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class KingdomBuilding<StructureStyle>
    • collect

      public long collect(@Nullable KingdomPlayer kp)
    • collect

      public long collect(@Nullable UUID id)
    • serialize

      @MustBeInvokedByOverriders public void serialize(SerializationContext<org.kingdoms.data.database.dataprovider.SectionableDataSetter> context)
      Specified by:
      serialize in interface org.kingdoms.data.Serializable
      Overrides:
      serialize in class Structure
      Parameters:
      context - can be also a ItemSerializationContext which implies that this building is being serialized into an in-game item.
    • deserialize

      @MustBeInvokedByOverriders public void deserialize(DeserializationContext<org.kingdoms.data.database.dataprovider.SectionableDataGetter> context)
      Specified by:
      deserialize in interface org.kingdoms.data.Deserializable
      Overrides:
      deserialize in class Structure