Class Extractor
java.lang.Object
org.kingdoms.constants.base.CompressedSmartObject
org.kingdoms.constants.base.KingdomsObject
org.kingdoms.constants.base.KeyedKingdomsObject<SimpleLocation>
org.kingdoms.constants.land.KingdomBlock
org.kingdoms.constants.land.abstraction.KingdomBuilding<StructureStyle>
org.kingdoms.constants.land.structures.Structure
org.kingdoms.constants.land.structures.objects.Extractor
- 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
-
Field Summary
Fields inherited from class org.kingdoms.constants.land.abstraction.KingdomBuilding
building, durability, level, styleFields inherited from class org.kingdoms.constants.land.KingdomBlock
originFields inherited from class org.kingdoms.constants.base.KingdomsObject
lastLogsExpirationCheck, logs, metadata, statisticsFields inherited from class org.kingdoms.constants.base.CompressedSmartObject
objectState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMessageContextEdits(MessagePlaceholderProvider context, Kingdom kingdom) longlongcollect(@Nullable KingdomPlayer kp) voiddeserialize(DeserializationContext<org.kingdoms.data.database.dataprovider.SectionableDataGetter> context) Estimates the remaining resource points this extractor can generate with the fuel it has left.voidCompletableFuture<List<org.bukkit.block.Hopper>> longdoublegetFuel()longdoubledoublegetMaxFuel(Kingdom kingdom, int level) longinthashCode()remove(org.kingdoms.events.items.KingdomItemRemoveContext context) voidserialize(SerializationContext<org.kingdoms.data.database.dataprovider.SectionableDataSetter> context) voidsetCollected(long collected) voidsetFuel(double fuel) voidsetLastCollected(long lastCollected) voidsetLastCollector(UUID lastCollector) Methods inherited from class org.kingdoms.constants.land.structures.Structure
getDataMap, getDisplayName, getKingdomBlockHandler, getNameOrDefault, place, setNameMethods inherited from class org.kingdoms.constants.land.abstraction.KingdomBuilding
addMessageContextEdits, canFunction, decreaseDurability, displayParticle, displayParticle, dropItem, equals, eval, eval, getBlock, getBuilding, getBuildingSettings, getContext, getDurability, getItem, getKey, getLevel, getMaxLevel, getParticleDisplay, getPlaceholderContext, getStyle, getUpgradeCost, getVisualsManager, isEnabled, modifyData, ofSection, ofSection, ofSection, onBuildFinish, playSound, playSound, playSound, prepareBuilding, remove, repair, requireRepair, setBuilding, setDurability, setLevel, toString, update, upgradeMethods inherited from class org.kingdoms.constants.land.KingdomBlock
getLand, getOriginMethods inherited from class org.kingdoms.constants.base.KingdomsObject
getLogs, getMetadata, getNewestLog, getNewestLog, getStatistics, log, setLogs, setMetadata, setStatisticsMethods inherited from class org.kingdoms.constants.base.CompressedSmartObject
ensureValidObject, getCompressedData, getDataHandler, hasObjectExpired, invalidateObject, isNewData, isObjectStateSaved, saveObjectState, shouldSaveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kingdoms.locale.provider.CascadingMessageContextProvider
getMessageContextMethods inherited from interface org.kingdoms.constants.land.FuelContainer
addFuel, hasFuelMethods inherited from interface org.kingdoms.constants.base.SmartObject
isDataEmpty
-
Constructor Details
-
Extractor
-
-
Method Details
-
getLastCollected
public long getLastCollected() -
setLastCollected
public void setLastCollected(long lastCollected) -
getLastCollector
-
setLastCollector
-
setCollected
public void setCollected(long collected) -
getFuel
public double getFuel()- Specified by:
getFuelin interfaceFuelContainer
-
setFuel
public void setFuel(double fuel) - Specified by:
setFuelin interfaceFuelContainer
-
getMaxFuel
public double getMaxFuel()- Specified by:
getMaxFuelin interfaceFuelContainer
-
remove
-
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
-
getTotalFuelFromAttachedHoppers
public long getTotalFuelFromAttachedHoppers() -
fillFuelFromAttachedHoppers
public void fillFuelFromAttachedHoppers() -
addMessageContextEdits
@MustBeInvokedByOverriders public MessagePlaceholderProvider addMessageContextEdits(MessagePlaceholderProvider context, Kingdom kingdom) - Overrides:
addMessageContextEditsin classStructure
-
getMaxFuel
-
hashCode
public int hashCode()- Overrides:
hashCodein classKingdomBuilding<StructureStyle>
-
collect
-
collect
-
serialize
@MustBeInvokedByOverriders public void serialize(SerializationContext<org.kingdoms.data.database.dataprovider.SectionableDataSetter> context) -
deserialize
@MustBeInvokedByOverriders public void deserialize(DeserializationContext<org.kingdoms.data.database.dataprovider.SectionableDataGetter> context) - Specified by:
deserializein interfaceorg.kingdoms.data.Deserializable- Overrides:
deserializein classStructure
-