» 如果你喜欢这个插件,也请务必看看 我们的其他插件 «
Rebalance Villagers
本插件允许你配置与村民相关的详细游戏机制集合。其最显著的功能是能够完全控制可生成的交易内容——默认情况下,它还附带了经过大量重做的价格表,旨在大幅降低交易被滥用的可能性,同时仍使其保持盈利潜力(详见后文)。
本插件的默认设置足以修复当前存在漏洞的村民交易系统——但如果你希望自己的服务器拥有一些独特的调整,以便完美平衡交易体验,本插件允许你调整以下内容:
在 config.yml 中,你可以找到通用设置:
- 交易内容的移除控制:你可以选择一项交易在被移除前可以进行多少次交易、交易内容多久后被移除,或者直接禁用交易内容移除功能。
- 交易内容的生成控制:你可以选择村民初始拥有多少项交易、一次生成多少项交易、交易内容多久后生成、村民是否在任何交易后都会生成新交易,以及交易内容的生成概率是多少。
- 通用交易设置:你可以控制当村民添加/移除交易时装饰性粒子效果的持续时间、选择玩家是否能与幼年村民进行交易,以及选择是否允许玩家通过互相踢出交易窗口来争夺村民。
- 关于村民本身的通用设置:你可以指定他们的最大生命值、使他们免疫所有伤害,并选择哪些村民职业可以自然生成。
- 还有一些与 Shopkeepers 插件配合使用相关的技术设置,但在 Shopkeepers 与本插件实现完全兼容后,这些设置将被移除(这些设置并无特殊魔法效果;你不会想念它们的)。
在 offers.yml 中,你可以找到控制村民可提供的交易的设置:
- 你可以定义主要货币物品,该物品将用于你包含的所有非自定义交易——为了方便起见,它也可以在你的自定义交易中使用。
- 你可以定义每个村民职业可以生成的所有交易,以及默认生成的交易。
- 你可以为你自己的自定义村民职业定义交易(可以通过世界编辑器生成,或通过编辑 config.yml 允许它们自然生成)。自定义职业的数量几乎是无限的(除非你想要超过 40 亿个),但它们看起来都与未使用的绿袍村民相同。
- 你可以移除现有交易或使其永不生成。
- 你可以将交易定义为“买入”、“卖出”,以使用现有的价格表,或者定义为“其他”以创建自定义交易。
- 自定义交易让你完全控制两个输入槽和一个输出槽,从而支持不使用货币物品的交易、提供随机或特定附魔的交易、任何物品或方块具有任意耐久度的交易,以及几乎任何世界/NBT 编辑器能创建的交易类型(唯一无法做到的是提供包含特定文本的书)。注意,物品数量和附魔等级也可以随机化!
- 你可以控制非自定义交易所使用的价格表中的数值。
所有这些功能都在配置文件中进行了详细说明。事实上,offers.yml 中包含一种类似“教程”的内容,指导你如何编辑它。
默认情况下,本插件...
默认情况下,本插件禁用了原版的游戏内交易内容移除系统,并更改了村民可生成的交易内容。
不会添加或移除任何交易,交易内容的生成概率也与原版 Minecraft 相同。然而,基于我在此帖中的工作,价格体系经过了大量重做。基本上,我创建了一个图表,根据众多标准仔细平衡物品价值,旨在产生比原版系统更合理且更难被滥用的价格体系。
我的插件默认禁用交易内容移除系统的原因是,除了许多玩家的投诉外,此帖解释了为什么该系统会导致在不利用漏洞的情况下交易变得不可用。正如我的默认设置旨在减少被滥用的潜在可能一样,它们也旨在减少需要被滥用的动机。
如果你希望从原版 Minecraft 设置开始,只需将 "offers-vanilla.yml" 的内容复制到 offers.yml 中,并在 config.yml 顶部查看原版关于交易内容移除的默认设置即可。
其他功能/便利功能
首先,除了 config.yml 和 offers.yml 中的详细说明外,你还应该感到高兴的是,我的插件内置了大量安全机制。如果你配置错误,插件不会崩溃(除非你使配置文件无法读取!)。相反,它会选择一个允许其安全运行的值(例如,如果指定为 0,而最低接受值为 1,插件将使用 1 代替)。现在,你可能认为这是件坏事,但插件会在发生这种情况时通知你:
警告仅在你配置出错时出现——否则,控制台通常不会被刷屏 ;)
此外,如果你在配置中遗漏了某个值,插件通常会回退到默认值——但不要养成这种习惯 :p
原版生成系统不允许你在出售物品时获得超过一个绿宝石,除非你手动指定自定义交易——尽管你可以指定以*一个*绿宝石换取*多个*物品的交易。我的插件修复了这个问题,使购买和出售价值的表格格式相同。因此,可以轻松创建如下交易:
这个插件最方便的功能可能是智能堆叠(Smart Stacking)和智能压缩(Smart Compression)。假设你想让村民以 98 个绿宝石的价格出售钻石头盔。玩家在一个槽位中不能放置超过 64 个绿宝石,而智能堆叠意识到了这一点。智能堆叠会自动为你完成以下操作:
智能堆叠基本上使 128 成为村民能接受的单个物品的最大数量(警告:智能堆叠目前还不够智能,无法意识到某些物品不可堆叠或最多只能堆叠至 16 个。为此,恐怕你需要制作自定义交易,但这并不难)。
有时你需要村民接收超过 128 个物品,这时就需要用到智能压缩。以下是处理要求 129 个绿宝石的交易的方式:
如果你将这些绿宝石块转换为绿宝石,并将剩余的绿宝石加上去,你会发现总数确实是 129。智能压缩有效地将你的上限增加到了 640:一个压缩物品的堆和一个未压缩物品的堆。此外,智能压缩适用于绿宝石、钻石、金锭、金粒和铁锭,所有这些都可以轻松以 9:1 的比例转换为压缩形式,并同样转换回来——因此,你可以将货币物品设置为这些物品中的任何一个,并确信智能压缩仍然适用。
使用我的图表自行平衡交易并将结果导出到你的配置文件中
我想这也算是一个便利功能,但它值得单独列出一节。还记得我之前提到的那张图表吗?你可以在此下载,它是完全可交互的。
图表中唯一一个值不是由其他单元格计算得出的单元格是金矿石旁边的金色单元格。它相当于一种“黄金标准”,决定了绿宝石的价值。将其翻倍,绿宝石的价值就会减半;将其减半,绿宝石的价值就会翻倍,依此类推。其余单元格会根据你的更改自动更新。
如果您不想使用绿宝石作为货币物品,可以选择您希望使用的其他物品。如果该物品在表格中,请找到其“按实用性调整”列对应的数值。该列为粗体显示,因为它代表了该物品相对于绿宝石的实际价值。接下来,取该数值的倒数,并将其填入金色单元格(例如,若要将货币设置为钻石,则在金色单元格中输入 1/17.7999)。如果操作正确,该物品的“按实用性调整”值应变为 1,因为这确实意味着它等于自身的一个单位。表格中所有其他单元格的数值均已重新计算,现在以所选物品而非绿宝石计价。
您可以通过编辑单元格的公式,或编辑图表右侧的特殊变量(“修饰符”列,U 列),对图表进行其他任何更改。
最后,请查找 “Rebalance Villagers Plugin”,单元格 AC1。在该区域附近,有四个单元格(位于 “将此代码复制到 offers.yml” 列)的内容必须复制到 offers.yml 中。每个单元格的正确目标位置在 AC 列中指定,而需要复制的实际值在 AD 列中。只需将这些内容复制进去,同时擦除不需要的原始值,插件就会使用这些新值。
注意:如果单元格 AF6 提示存在错误,请在 V 列(“有效交易检查器”)中查看具体错误原因。这些错误通常出现在生成了无效交易时,例如无法完成的交易(请求的物品数量超过玩家输入槽位的容纳上限)、会产生不可能存在的物品堆叠的交易(例如工具堆叠),或不合逻辑的情况(如村民以零绿宝石的成本提供物品)。 因此,请务必在复制配置输出之前确认 AF6 中没有报告任何错误!
另外,如果您更改了图表中的货币物品,请记得也在 offers.yml 中修改 'currency-item'!
开发版本 (Dev Builds)
你始终可以在 Jenkins 找到最新的快照版本。¹
Github 源代码
该插件的源代码可以在这里找到。这是我的第一个插件,如果发现我有什么非常新手级的操作,请随时告诉我 :p
如果您希望为该插件做出贡献,可以使用拉取请求(Pull Requests)。在您创建或大幅修改的任何部分的 javadoc 标签中添加您的 '@author' 信息——您可以使用您喜欢的任何名称来标识自己。当然,我会公开致谢您对项目的贡献。
特别感谢
- WolfieMario,本插件的初始创建者:感谢您提供了整个创意和通过这个优秀插件的机会,以及您在此所做的一切工作!
- nisovin,Shopkeepers 插件的创建者:感谢他/她将 Shopkeepers 开源,这使得 WolfieMario 能够使该插件与其兼容,并放心他在代码中没有做任何极其错误的事情。
- Icyene,在 WolfieMario 刚开始时为他指明了正确的方向——如果没有他的大量帮助,他将完全不知道如何开始编写这个插件。
¹ 本项目的开发版本可以在提供的持续集成服务器上获取。这些版本未经 BukkitDev 团队批准。请自行判断风险使用。
· · ·
» Powered by Cube Nation «
» If you like this plugin you should definitely check out our other plugins too «
Rebalance Villagers
This plugin allows you to configure a detailed collection of game mechanics pertaining to villagers. Its most notable feature is complete control over the offers which can be generated - by default, it also starts with an extensively reworked set of prices to make trading dramatically less abusable while still allowing it to be profitable (more on that later).
This plugin's default settings may be enough to repair the currently exploitable villager trading system - however, in case you want your own server to have a few special touches, so trading can be balanced perfectly for it, this plugin allows you to adjust the following:
In config.yml, you'll find general settings:
- Control over offer removal: You can choose how many times an offer can be traded before being removed, how long it takes for offers to be removed, or simply disable offer removal altogether.
- Control over offer generation: You can choose how many offers a villager starts with, how many offers are generated at once, how long it takes for offers to be generated, whether villagers generate offers after any trade, and what the chance of offer generation is.
- General trading settings: You can control how long the decorative particle effect lasts when villagers add/remove offers, choose whether players can trade with villager children, and choose whether players can squabble over villagers by letting them kick each other out of the trading window.
- General settings about villagers themselves: You can specify their max health, make them invulnerable to all harm, and choose which villager professions can spawn naturally.
- There are also some technical settings related to using this plugin with Shopkeepers, but once full compatibility between Shopkeepers and this plugin are established, these will be removed (these settings don't do anything magical; you won't miss them).
In offers.yml, you'll find settings to control the offers villagers can make:
- You can define your primary currency item, which will be used by all non-custom offers you include - it can also be used in your custom offers, for convenience.
- You can define all of the offers which can be generated by each villager profession, and the offers which get generated by default.
- You can define offers for your own custom villager professions (which can be spawned with world editors, or by editing config.yml to allow them to spawn naturally). The number of custom professions is virtually unlimited (unless you want more than 4 billion), but they all appear identical to the unused green villager.
- You can remove existing offers or make them never generate.
- You can define offers as 'buys', or 'sells', to use an existing table of prices, or 'other' to create custom offers.
- Custom offers give you full control of the two input slots and output slot, allowing for offers which don't use the currency item, offers which provide random or specific enchantments, offers with any damage value on any item or block, and almost any type of offer a world/NBT editor could create (the only thing you can't do is have offers which provide books containing specific text). Note that item quantities and enchantment levels can be randomized, too!
- You can control the values in the tables of prices, used by non-custom offers.
All of these features are explained in detail in the config files. In fact, offers.yml has a sort of "tutorial" on how to edit it.
By default, this plugin...
By default, this plugin disables the vanilla system of offer removal, and changes the offers which villagers can generate.
No offers are added or removed, and the chances of offers are also the same as they are in vanilla Minecraft. However, pricing has been extensively reworked, based on my work in this thread. Basically, I have created a chart which carefully balances the values of items based on many criteria, geared at producing a far more sensible and less exploitable set of prices than the vanilla system.
The reason my plugin disables the offer removal system by default is because, aside from many players' complaints, this thread explains why the system makes trading unusable without exploitation. Just as my defaults are intended to reduce the potential for exploitation, they are intended to reduce the need for exploitation.
If you wish to start with vanilla Minecraft settings, simply copy the contents of "offers-vanilla.yml" into offers.yml, and see the top of config.yml for vanilla defaults on offer removal.
Other Features/Conveniences
First, alongside the detailed explanations in config.yml and offers.yml, you'll be happy to know my plugin has a load of failsafes packed in. If you configure it incorrectly, the plugin will not crash (unless you make the config files unreadable!). Instead, it will choose some value which allows it to safely run (for example, if you specified a number as 0 when the lowest accepted value is 1, the plugin will use 1 instead). Now, you may be thinking that's a bad thing, but the plugin will let you know when this happens:
Warnings will only appear when you've done something incorrectly in the config - otherwise, normally the console doesn't get spammed ;)
Also, if you leave a value out of the configuration, the plugin will usually revert to a default - but don't make a habit out of this :p
The vanilla generation system doesn't allow you to earn more than one emerald from selling an item, unless you manually specify a custom offer - despite being able to specify offers which *give* more than one item in exchange for one emerald. My plugin fixes this, making the buy and sell values tables formatted the same way. Thus, it's easy to make offers like this one:
Probably my most convenient features in this plugin are Smart Stacking and Smart Compression. Let's say you want a villager to sell a diamond helmet for 98 emeralds. A player can't place more than 64 emeralds in one slot, and Smart Stacking realizes that. Smart Stacking will automatically do this for you:
Smart Stacking basically makes 128 the maximum amount of an item a villager can accept (warning: Smart Stacking is currently not smart enough to realize certain items do not stack or stack only up to 16. For this, I'm afraid you'll need to make a custom offer, but that's not difficult).
Sometimes you need a villager to take more than 128 of an item, and that's when Smart Compression comes in. Here's how an offer requesting 129 emeralds is handled:
If you were to convert those emerald blocks into emeralds and add the rest of the emeralds to it, you would see the total is indeed 129. Smart Compression effectively increases your maximum up to 640: a stack of the compressed item, and a stack of the uncompressed item. Also, Smart Compression works on emeralds, diamonds, gold ingots, gold nuggets, and iron ingots, all of which can easily be converted into a compressed form at a ratio of 9-per-compressed-item and likewise converted back - thus, you can set your currency item to any of those items and rest assured that Smart Compression will still apply.
Using My Chart to Balance Trading Yourself and Exporting the Results to Your Configuration
I suppose this is also a convenience/feature, but it deserves its own section. Remember that chart I mentioned earlier? It can be downloaded here, and is fully interactive.
The only cell in the chart with a value not calculated from other cells is the gold-colored cell next to Gold Ore. It's a sort of "gold standard", if you will, which determines how much emeralds are worth. Double it, and emeralds are halved in value. Halve it, and emeralds are doubled in value, and so on. The rest of the chart will update with your changes.
If you don't want to use emerald as your currency item, you can choose an item you do want to use. If it's in the chart, find its value in the "Adjusted for Usefulness" column. This column is bold because it represents the actual worth of that item in emeralds. Now, take that number and invert it, and place that inversion in the golden cell (so, to set the currency to diamond, you would put 1/17.7999 into the gold cell). If you did this correctly, the "Adjusted for Usefulness" of that item should read 1, as it is indeed worth one of itself. All other cells in the chart have been recalculated in value, and are now priced in that item instead of emeralds.
You can make any other changes to the chart by editing the formulas of its cells, or editing the special variables to the right of the chart (the "Modifiers" column, U).
Finally, look for "Rebalance Villagers Plugin", cell AC1. Around there, there are four cells (in the "Copy this code into offers.yml" column) which you must copy the contents of into offers.yml. The proper destinations of each are specified in AC, while the actual values to copy are in AD. Simply copy these in, erasing the unwanted original values in the process, and the plugin will new use these values.
Note: If the cell AF6 says there are errors, please look in the column V ("Valid Offer Checker") for what the errors are. These errors are when invalid offers are created, for example offers which are impossible to complete (requesting more items than the player can put in the input slots), offers which would produce impossible item stacks (e.g. stacked tools), or nonsensical situations such as a villager providing items at a cost of zero emeralds. So remember to make sure there are no errors reported in AF6 before you copy the config outputs!
Oh, and if you changed the currency item in the chart, be sure you change 'currency-item' in offers.yml too!
Dev Builds
You can always find the latest snapshot in the Jenkins.¹
Github Source Code
The source code of this plugin can be found here. It's my first plugin, so feel free to let me know if I've done anything horribly nooby :p
If you would like to contribute to the plugin, you may use Pull Requests. Add yourself with an '@author' in the javadoc tags of any part you create or substantially modify - you can identify yourself with whatever name you like. Of course, I will publicly acknowledge that you have contributed to this project.
Special Thanks
- WolfieMario, the initial creator of this plugin: thanks for the whole idea and opportunity with this great plugin and thanks for all your work you've done here!
- nisovin, the creator of the Shopkeepers plugin: thanks to him/her making Shopkeepers open-source, WolfieMario could make the plugin compatible with his and rest assured that he's not doing anything horribly wrong in the code.
- Icyene, for pointing WolfieMario in the right direction when he started - without his good deal of help, he would have had no clue how to start coding this plugin.
¹ Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
· · ·
» Powered by Cube Nation «
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
下载 Rebalance Villagers
版本 1.8.3
- 兼容 Spigot 1.8.3-R0.1-SNAPSHOT
版本 1.7.4
- 兼容 CB 1.7.4-R0.1-SNAPHOT
版本 1.6.4
- 兼容 CB 1.6.4-R2.0
版本 1.5.2
- 兼容 CB 1.5.2-R0.1(感谢 Jenjen1324)
版本 1.5.1
- 兼容 CB 1.5.1-R0.1
版本 1.5
- 兼容 CB 1.5.0-R0.1
版本 1.4.1
- 添加了插件指标数据
- 兼容 CB 1.4.7-R0.2
版本 1.4
- 兼容 CB 1.4.6-R0.3
- 查找并移除过时的交易提议(在升级到此插件后)
版本 1.3
- 兼容 CB 1.4.5-R1.0
- 完善了 Shopkeepers 连接器的封装,这样当未安装 Shopkeeper 时,启动就不会报错
版本 1.2
- 使用 Bukkit 调度器以防止线程问题/崩溃
- 修复了与 shopkeepers 插件配合使用时的一些问题
- 更新以兼容 1.4.5
- 对创建和移除交易提议的处理进行了一些细微改进
1.0.1 及更早版本
- 2012年8月5日:首次上传
- 2012年8月20日:添加了许多新的配置选项,包括村民生成交易的完整配置,以及与 Shopkeepers 的兼容性。
- 2012年8月20日:对一些警告信息进行了轻微修复,并对配置说明进行了澄清。
完整的更新日志请参见 此处。
如果你同时安装了此插件、Shopkeepers 以及一个可以生成村民的第三方插件(例如 VoxelSniper),建议查看 config.yml 中关于 Shopkeepers 的部分。如果将这些数值配置得过低,并在服务器严重卡顿时使用第三方插件生成村民,可能会导致崩溃。
你可能会遇到的两个原版漏洞(与此插件无关,但值得了解):
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
一个在游戏内运行的 Minecraft 地图编辑器! 支持选区、蓝图、复制粘贴、笔刷和脚本。 可在创造模式中使用,也可在生存模式中临时使用。

评论 0
登录后参与评分
还没有评论,来抢沙发吧