Class LandPriceManager
java.lang.Object
net.chen.legacyLand.resource.pricing.LandPriceManager
地价交互管理器(P3)。
维护:
- 每个区块的询问列表(ask/reply 用)。
- 每位玩家公开展示的区块集合(show/hide 用)。
- 询问 TTL 清理。
-
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupExpired(long ttlMillis) 清理过期询问。findInquiry(String chunkKey, long id) 找到指定 id 的询问;若 chunkKey 不匹配返回 null。intintstatic LandPriceManagerinit(LegacyLand plugin) booleanisMember(org.bukkit.entity.Player player, com.palmergames.bukkit.towny.object.Town town) 玩家是否为该 Town 的成员(含市长/国王)。booleanisPubliclyShown(String chunkKey) listInquiries(String chunkKey, long ttlMillis) voidonPlayerQuit(UUID playerId) 玩家离线时调用,释放其公开标记。booleanreplyInquiry(String chunkKey, long id, org.bukkit.entity.Player replier, double price) 回复询问,返回是否成功(询问不存在或已回复返回 false)。booleansubmitInquiry(org.bukkit.entity.Player asker, String world, int cx, int cz, String message, long ttlMillis) booleantoggleShown(UUID playerId, String chunkKey) 切换玩家对某 chunk 的公开状态。com.palmergames.bukkit.towny.object.TowntownOf(org.bukkit.Location loc) 当前 chunk 的 Town;未声明返回 null。
-
Method Details
-
init
-
townOf
public com.palmergames.bukkit.towny.object.Town townOf(org.bukkit.Location loc) 当前 chunk 的 Town;未声明返回 null。 -
isMember
public boolean isMember(org.bukkit.entity.Player player, com.palmergames.bukkit.towny.object.Town town) 玩家是否为该 Town 的成员(含市长/国王)。 -
toggleShown
-
setShown
-
isPubliclyShown
-
submitInquiry
public LandPriceInquiry submitInquiry(org.bukkit.entity.Player asker, String world, int cx, int cz, String message, long ttlMillis) -
listInquiries
-
findInquiry
找到指定 id 的询问;若 chunkKey 不匹配返回 null。 -
replyInquiry
public boolean replyInquiry(String chunkKey, long id, org.bukkit.entity.Player replier, double price) 回复询问,返回是否成功(询问不存在或已回复返回 false)。 -
cleanupExpired
public void cleanupExpired(long ttlMillis) 清理过期询问。 -
onPlayerQuit
玩家离线时调用,释放其公开标记。 -
getInquiryChunkCount
public int getInquiryChunkCount() -
getPublicChunkCount
public int getPublicChunkCount() -
getPlugin
-