Class Extractor
java.lang.Object
org.kingdoms.constants.metadata.KingdomsObject<SimpleLocation>
org.kingdoms.constants.land.abstraction.KingdomItem<StructureStyle>
org.kingdoms.constants.land.structures.Structure
org.kingdoms.constants.land.structures.objects.Extractor
- All Implemented Interfaces:
org.kingdoms.abstraction.LandOperator,FuelContainer
-
Field Summary
Fields inherited from class org.kingdoms.constants.land.abstraction.KingdomItem
level, location, styleFields inherited from class org.kingdoms.constants.metadata.KingdomsObject
metadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongcollect(@Nullable KingdomPlayer kp) 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) Pair<org.bukkit.inventory.ItemStack,NBTTagCompound> getTags()longinthashCode()remove(org.kingdoms.events.items.KingdomItemRemoveContext context) voidserialize(SerializationContext<org.kingdoms.data.database.dataprovider.SectionableDataSetter> context) voidsetCollected(long collected) voidvoidsetFuel(double fuel) voidsetLastCollected(long lastCollected) voidsetLastCollector(UUID lastCollector) Methods inherited from class org.kingdoms.constants.land.structures.Structure
getDisplayName, getNameOrDefault, place, removeData, setName, toStringMethods inherited from class org.kingdoms.constants.land.abstraction.KingdomItem
displayParticle, displayParticle, dropItem, equals, eval, eval, getBlock, getCompressedData, getContext, getDataKey, getEdits, getHolograms, getItem, getLand, getLevel, getLocation, getMaxLevel, getStyle, getUpgradeCost, ofSection, ofSection, ofSection, playSound, playSound, remove, removeHolograms, removeHolograms, round, setHolograms, setLevel, spawnHolograms, spawnHolograms, updateHolograms, upgradeMethods inherited from class org.kingdoms.constants.metadata.KingdomsObject
compressBoolean, compressCollecton, compressCollecton, compressColor, compressInventory, compressLocation, compressLocation, compressMap, compressMetadata, compressString, compressUUID, getMetadata, getSaveMeta, setMetadata, setSaveMeta, shouldSaveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kingdoms.constants.land.FuelContainer
addFuel, hasFuel
-
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() -
getEdits
-
getMaxFuel
-
hashCode
public int hashCode()- Overrides:
hashCodein classKingdomItem<StructureStyle>
-
collect
-
collect
-
serialize
public void serialize(SerializationContext<org.kingdoms.data.database.dataprovider.SectionableDataSetter> context) -
getTags
-
setDataFromNBT
- Overrides:
setDataFromNBTin classStructure
-