Class BuildingItemOfferSession
java.lang.Object
org.kingdoms.managers.buildings.itemoffer.BuildingItemOfferSession
- Direct Known Subclasses:
BuildingFuelItemOffer,BuildingRepairItemOffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionMust be the closest building to the item that actually needs the item.protected final org.bukkit.entity.Itemprotected final org.bukkit.inventory.ItemStackprotected final SimpleLocationprotected booleanprotected final org.bukkit.entity.Player -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuildingItemOfferSession(org.bukkit.entity.Player player, org.bukkit.entity.Item droppedItem, SimpleLocation droppedLocation, org.bukkit.inventory.ItemStack droppedItemStack) We gather all the information from the constructor rather than making it ourselves because of performance. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcheckBuilding(KingdomBuilding<?> building) protected booleancompareNeedsAndDistance(KingdomBuilding<?> building, boolean currentFull) abstract org.kingdoms.managers.buildings.itemoffer.ItemOfferResult
-
Field Details
-
building
Must be the closest building to the item that actually needs the item. If none of the building needs the item, then get the closest one. -
matchedItem
-
lastBuildingNeedsItem
protected boolean lastBuildingNeedsItem -
player
protected final org.bukkit.entity.Player player -
droppedItem
protected final org.bukkit.entity.Item droppedItem -
droppedLocation
-
droppedItemStack
protected final org.bukkit.inventory.ItemStack droppedItemStack
-
-
Constructor Details
-
BuildingItemOfferSession
protected BuildingItemOfferSession(org.bukkit.entity.Player player, org.bukkit.entity.Item droppedItem, SimpleLocation droppedLocation, org.bukkit.inventory.ItemStack droppedItemStack) We gather all the information from the constructor rather than making it ourselves because of performance.
-
-
Method Details
-
checkBuilding
-
finalizeProcess
public abstract org.kingdoms.managers.buildings.itemoffer.ItemOfferResult finalizeProcess() -
compareNeedsAndDistance
-