Shoppers - Lightman's Currency NPC 插件
Shoppers 是适用于 NeoForge 1.21.1 的 Lightman's Currency 插件,为游戏添加了具有实用功能的 NPC 顾客。这些 NPC 会在玩家拥有的商店周围生成,浏览库存、购买商品、使用 ATM 机以及玩老虎机,有助于在单人世界或服务器中充实活跃的经济参与者。
功能特性
生成行为与视觉效果
- 定向生成:NPC 会在活跃的玩家商店半径 24-40 格范围内生成,并自动寻路前往商业枢纽。
- 生物群系专属外观:Shoppers 渲染时会穿着分层式的生物群系服装(平原、针叶林、沙漠和雪地),无缝叠加在基础村民模型之上。
- 自定义名称:超过 50 个与经济主题相关的名字(例如 Scrooge McDirt、Stonks Steve 和 WallStreet Wally)会以 3D 形式显示在顾客头顶上方。
- 原版移动速度:Shoppers 以逼真的速度行走(与标准原版村民一致),而不是 erratic 地乱跑。
经济阶级
顾客属于以下四个阶级之一,这决定了他们的起始货币和感兴趣的物品:
- 农民 (Peasants):持有铁币。购买基础建筑方块(泥土、圆石、橡木原木、种子和廉价食物)。
- 市民 (Citizens):持有金币。购买日常用品(煤炭、羊毛、火把、床、熟食和玻璃)。
- 商人 (Merchants):持有绿宝石币。购买工具、武器、盔甲、生/熟矿石、锭和盾牌。
- 大亨 (Tycoons):持有下界合金币。购买高价值物品(钻石、附魔书、潜影盒、图腾和鞘翅)。
智能 AI 交互
- 通用商店兼容性:Shoppers 可与所有 Lightman's Currency 交易方块互动,包括自动售货机、货架、冷冻柜、冰箱、展示柜、盔甲架、书架交易者、卡片展示架和拍卖台。
- 虚拟钱包与自动兑换:Shoppers 携带统一的铜币等价预算。他们可以使用高等级硬币购买低价值物品,模组会自动处理硬币扣除并找零。
- 防止拥挤:Shoppers 会检查交易方块、ATM 机或赌场机器是否在 1.5 格范围内被其他实体占用。如果被占用,它们将绕过该目标以防止堆积。
- ATM 寻路:当 Shoppers 的钱包余额低于 500 铜币时,它们会寻路前往附近的 ATM 机存取款,并选择随机的空闲 ATM 机以分散人群。
真实的赌博机制
Shoppers 在玩之前会评估老虎机和扭蛋机的风险:
- 赔率检查:Shoppers 使用安全的反射机制检查老虎机的加权奖励和总权重。
- 风险阈值:市民和农民拒绝玩胜率低于 15% 的机器。大亨和商人对风险承受能力更强,可接受低至 5% 胜率的机器。
- 鲁莽行为:有 10% 的概率 NPC 完全无视赔率并继续游玩。
每日日程
市场遵循基于游戏时间的每日循环:
- 早高峰时段(刻 1000 - 4000):Shoppers 生成速度加倍,本地枢纽容量增加 50%,且 Shoppers 行走速度稍快(0.75 倍速修正)。
- 晚间赌场高峰(刻 9000 - 12000):赌场人群达到峰值。大亨和市民出现,玩老虎机并在拍卖台上竞价。
- 夜间闭市(刻 13000 - 23000):生成几乎完全停止。Shoppers 移动缓慢(0.45 倍速修正),如果远离活跃玩家,它们将会消失并伴有粒子效果。
制作估值引擎
- 动态价值计算器:没有预定义价格的自定义或模组物品会通过递归检查服务器的配方注册表来动态估值,计算原料价值总和并除以产出数量。
- 自定义价值:服务器操作员可以使用
/shoppers value set <item> <copper_worth> 命令定义物品的自定义价值。
- 捡漏专家:Shoppers 优先选择具有高“捡漏分数”(市场价值与价格比率)的交易。如果它们发现折扣高达 40% 或以上的优惠,即使该物品不在其阶级兴趣范围内,也会购买。
性能与优化
- SavedData 注册表:所有放置的经济方块的坐标数据全局存储在
ShoppersWorldData 中,完全消除了 AI 目标中对重型基于刻的方块扫描的需求。
- 以玩家为中心的扫描:优化的后台循环每 5 秒扫描活跃玩家附近的区块,以自动发现并注册预先存在的商店。
- AI 寻路冷却:如果目标方块变得不可达,AI 目标会应用严格的冷却时间,消除寻路垃圾信息和刻数尖峰。
指令
/shoppers value <item> - 返回物品的计算市场价值。
/shoppers value set <item> <copper_worth> - 配置物品的持久自定义价值(需要管理员权限)。
要求与兼容性
- Lightman's Currency(必需)
- NeoForge 1.21.1
- 开箱即用兼容模组物品和子插件。
Shoppers - Lightman's Currency NPC Addon
Shoppers is a NeoForge 1.21.1 addon for Lightman's Currency that adds functional NPC customers to the game. These NPCs spawn around player-owned shops, browse inventory, buy products, use ATMs, and play casino slot machines, helping populate singleplayer worlds or servers with active economic participants.
Features
Spawn Behavior and Visuals
- Targeted Spawning: NPCs spawn within a 24-40 block radius of active player-owned shops and automatically pathfind toward commercial hubs.
- Biome-Specific Skins: Shoppers render with layered biome clothing (Plains, Taiga, Desert, and Snow) seamlessly composed over base villager models.
- Custom Names: Over 50 economy-themed names (such as Scrooge McDirt, Stonks Steve, and WallStreet Wally) display in 3D above customer heads.
- Vanilla Speeds: Shoppers walk at realistic speeds (matching standard vanilla villagers) rather than running erratically.
Economic Classes
Customers belong to one of four classes, which determines their starting currency and item interests:
- Peasants: Hold iron coins. Buy basic building blocks (dirt, cobblestone, oak wood, seeds, and cheap food).
- Citizens: Hold gold coins. Buy everyday items (coal, wool, torches, beds, cooked food, and glass).
- Merchants: Hold emerald coins. Buy tools, weapons, armor, raw/cooked ores, ingots, and shields.
- Tycoons: Hold netherite coins. Buy high-value items (diamonds, enchanted books, shulker boxes, totems, and elytra).
Smart AI Interactions
- Universal Shop Compatibility: Shoppers interact with all Lightman's Currency trade blocks, including vending machines, shelves, freezers, fridges, display cases, armor stands, bookshelf traders, card displays, and auction stands.
- Virtual Wallets and Automatic Exchange: Shoppers carry unified copper-equivalent budgets. They can buy low-value items using high-tier coins, and the mod handles coin deduction and returns change automatically.
- Crowd Prevention: Shoppers check if a trade block, ATM, or casino machine is occupied by another entity within 1.5 blocks. If occupied, they will bypass it to prevent piling up.
- ATM Pathfinding: When a shopper's wallet drops below 500 copper coins, they pathfind to nearby ATMs to withdraw or deposit funds, choosing random unoccupied ATMs to distribute crowds.
Realistic Gambling Mechanics
Shoppers evaluate slot and gacha machine risks before playing:
- Odds Checking: Shoppers inspect the weighted rewards and total weights of slot machines using safe reflection.
- Risk Thresholds: Citizens and Peasants refuse to play machines with a win chance below 15%. Tycoons and Merchants accept riskier machines down to 5%.
- Reckless Behavior: There is a 10% chance an NPC ignores the odds completely and plays anyway.
Daily Schedule
The marketplace follows a daily cycle based on game time:
- Morning Rush Hour (Ticks 1000 - 4000): Shoppers spawn twice as fast, local hub capacity increases by 50%, and shoppers walk at a slightly faster pace (0.75 modifier).
- Evening Casino Rush (Ticks 9000 - 12000): Casino crowds peak. Tycoons and citizens emerge to play slot machines and bid on auction stands.
- Night Closing (Ticks 13000 - 23000): Spawning is almost entirely halted. Shoppers move slowly (0.45 modifier) and will despawn with a puff particle effect if they are far from active players.
Crafting Valuation Engine
- Dynamic Worth Calculator: Custom or modded items without predefined prices are valued dynamically by recursively checking the server's recipe registry, summing ingredient values, and dividing by the output count.
- Custom Values: Server operators can define custom item values using
/shoppers value set <item> <copper_worth>.
- Bargain Hunters: Shoppers prioritize deals with high bargain scores (market value vs. price ratio). If they spot a deal discounted by 40% or more, they will buy it even if the item falls outside their class interests.
Performance and Optimization
- SavedData Registry: Coordinate data for all placed economic blocks is stored globally in
ShoppersWorldData, completely removing the need for heavy tick-based block scanning in AI goals.
- Player-Centric Scanning: An optimized background loop scans chunks near active players every 5 seconds to automatically discover and register pre-existing shops.
- AI Pathfinding Cooling: AI goals apply strict cooldowns if a target block becomes unreachable, eliminating pathfinding spam and tick spikes.
Commands
/shoppers value <item> - Returns the calculated market worth of an item.
/shoppers value set <item> <copper_worth> - Configures a persistent custom value for an item (requires administrator permissions).
Requirements and Compatibility
- Lightman's Currency (Required)
- NeoForge 1.21.1
- Out-of-the-box compatibility with modded items and sub-addons.
评论 0
登录后参与评分
还没有评论,来抢沙发吧