Class MarketManager
java.lang.Object
net.chen.legacyLand.market.MarketManager
市场管理器 - 处理市场箱子的注册、定价和购买逻辑
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionvoidclearPendingPriceSet(UUID playerId) createMarket(org.bukkit.entity.Player player, String name) 在当前地块创建市场(需要城镇权限)voidcreateMarketPointOnMap(String name, org.bukkit.entity.Player player, double x, double y, double z) deleteMarket(org.bukkit.entity.Player player) 删除当前地块的市场getChestAt(org.bukkit.Location loc) static MarketManagerstatic MarketManagergetInstance(LegacyLand plugin) getMarketAt(org.bukkit.Location loc) getPendingChestKey(UUID playerId) booleanhasPendingPriceSet(UUID playerId) voidinit(Connection conn) booleanisMarketChest(org.bukkit.Location loc) purchaseFromChest(org.bukkit.entity.Player buyer, org.bukkit.Location chestLoc) 玩家购买箱子内物品(买家点击销售箱)booleanregisterChest(org.bukkit.entity.Player player, org.bukkit.Location loc) 注册销售箱(玩家在市场地块放置箱子时自动调用)voidremoveMarketPointFromMap(String name, String worldName) voidsetPendingChest(UUID playerId, String locationKey) 玩家点击箱子时记录目标箱子setPrice(org.bukkit.entity.Player player, double price) 执行定价:将玩家手持物品与箱子绑定并设置价格voidstartPriceSet(org.bukkit.entity.Player player) 开始设置价格流程:记录玩家等待状态booleanunregisterChest(org.bukkit.Location loc) 注销销售箱(玩家破坏箱子时调用)
-
Method Details
-
getInstance
-
getInstance
-
init
-
createMarket
在当前地块创建市场(需要城镇权限) -
deleteMarket
删除当前地块的市场 -
registerChest
public boolean registerChest(org.bukkit.entity.Player player, org.bukkit.Location loc) 注册销售箱(玩家在市场地块放置箱子时自动调用) -
unregisterChest
public boolean unregisterChest(org.bukkit.Location loc) 注销销售箱(玩家破坏箱子时调用) -
startPriceSet
public void startPriceSet(org.bukkit.entity.Player player) 开始设置价格流程:记录玩家等待状态 -
setPendingChest
-
hasPendingPriceSet
-
getPendingChestKey
-
clearPendingPriceSet
-
setPrice
执行定价:将玩家手持物品与箱子绑定并设置价格 -
purchaseFromChest
public MarketManager.PurchaseResult purchaseFromChest(org.bukkit.entity.Player buyer, org.bukkit.Location chestLoc) 玩家购买箱子内物品(买家点击销售箱) -
getMarketAt
-
getChestAt
-
isMarketChest
public boolean isMarketChest(org.bukkit.Location loc) -
createMarketPointOnMap
public void createMarketPointOnMap(String name, org.bukkit.entity.Player player, double x, double y, double z) -
removeMarketPointFromMap
-