如果没有 skeletonofchaos 的工作,这个插件就不可能存在。谢谢!
按住弓时左键点击以选择下一个箭矢类型。右键点击以发射选定的箭矢类型。如果在左键点击时按住潜行按钮(默认为 Shift),则可以选择上一个箭矢类型。
功能:
- 使用 Bukkit 权限系统
- 简单易用(无需命令,配置可选)
- 可扩展(开发者可以轻松添加自己的箭矢类型)
- 可以为玩家提供无限箭矢
- 可选的每种箭矢所需材料
- 可选的每种箭矢费用(需要 iConomy 5.x)
- 爆炸 - 在目标位置产生小型爆炸
- 闪电 - 闪电击中目标位置
- 钻头 - 在方块/实体下方创建一个洞,非常适合捕捉动物
- 水 - 在目标位置生成一小片水域
- 火把 - 在目标位置放置一个火把或点燃实体
- 动物 - 在目标位置随机生成猪、牛、羊或鸡
- 传送 - 将你传送到目标位置,或将命中的实体传送到随机位置
- 权限设置:
注意:这指的是 Bukkit 权限系统,而不是 Permissions 插件。新系统中没有 '*' 节点,因此你不能给用户分配 'multiarrow.*'。
你需要配合此插件使用新的 Bukkit 权限系统。这里有一份出色的迁移指南 可供参考。这将节省你未来的时间和精力,因为 Permissions 已不再是保护服务器最安全、最简单的方式。
- multiarrow.use.all - 允许用户使用所有箭矢类型(默认:op)
- multiarrow.use.<name> - 允许用户使用 <name> 类型的箭矢
- multiarrow.infinite - 无限箭矢!(默认:false)
- multiarrow.free-fees - 跳过 iConomy 费用检查(默认:op)
- multiarrow.free-materials - 跳过额外材料检查(默认:op)
- 配置说明:
注意:如果你是从 MultiArrow v0.9.7 或更早版本升级,请备份或删除你的 config.yml,并让 MultiArrow 创建一个新的配置文件,因为自那时起配置格式已发生变化。
如果你希望,可以要求用户支付一种给定物品的一个单位来使用特定的箭矢类型。要做到这一点,只需参考下面的模板编辑你的 MultiArrow/config.yml。要添加新的要求,只需添加一行,以箭矢类型名称为键,物品 ID 为值。目前,你只能为给定的箭矢类型设置一个 ID。如果你想为此目的使用彩色羊毛或染料,请在数据值前加上冒号并用单引号包裹它(例如黄色羊毛为 '35:4')。如果省略引号,冒号会导致你的配置文件出错,直到移除或正确引用为止。
requirements:
lightning: 348
explosive: 289
teleport: '35:4'
torch: 263
你还可以在 config.yml 的 remove-arrow 部分添加行,以控制效果触发后哪些箭矢会被移除。所有箭矢类型的默认值均为 true(即效果触发后所有箭矢都会被移除),因此你只需在此处将某些内容设置为 false。以下是一个示例,允许你重复使用传送箭矢(感谢 twiclo!):
remove-arrows:
teleport: false
如果你使用 iConomy 5.x,你可以向玩家收取发射特定箭矢类型的费用。请注意,所有费用都必须包含小数点("50" 是错误的,"50.0" 是正确的)。以下是配置此功能的示例:
fees:
teleport: 500.0
animal: 10.75
如果你使用了费用功能,并且希望在每次收取费用时让用户收到包含其更新余额的消息,请将以下选项设置为 true:
options:
send-balance-on-fee: true
自定义箭矢类型:
你可以用几行 Java 代码轻松添加自己的箭矢类型。从 GitHub 获取我的源代码副本,然后在 com.ayan4m1.multiarrow.arrows 包中添加你自己的类。为了举例说明,假设我们要创建一个生成鸡的箭矢。
public class ChickenArrowEffect implements ArrowEffect {
public void onEntityHitEvent(Arrow arrow, Entity target) { }
public void onGroundHitEvent(Arrow arrow) {
arrow.getWorld().spawnCreature(arrow.getLocation(), CreatureType.CHICKEN);
}
}
然后,将你的类名添加到 `ArrowType` 枚举中。例如,如果我们的类名为 "ChickenArrowEffect",则需在 ArrowType 中添加以下内容:
public enum ArrowType {
NORMAL,
CHICKEN
}
插件会自动将该类型名称作为选项提供给用户,并在用户发射你创建的箭矢时,动态实例化并运行你的 ArrowEffect 中的 onEntityHitEvent/onGroundHitEvent 方法。
如果你编写了一个稳定且有趣的箭矢类型,请在此回复附上源代码链接,或从你的个人分支提交拉取请求(pull request)至我的 GitHub 仓库。
下载/源代码:
源代码
This plugin would not be possible without the work of skeletonofchaos. Thank you!
Left-click while holding a bow to select the next arrow type. Right-click to fire the selected arrow type. If you hold down the Sneak button (Shift, by default) when left-clicking, you can select the previous arrow type.
Features:
- Uses Bukkit permissions
- Simple to use (no commands, configuration optional)
- Extensible (developers can add their own arrow types easily)
- Can give player(s) infinite arrows
- Optional per-arrow required material
- Optional per-arrow fee (requires iConomy 5.x)
- Explosive - Small explosion at the destination
- Lightning - Lightning strikes the destination
- Drill - Creates a hole under block/entity, great for catching animals
- Water - Creates small patch of water at the destination
- Torch - Places a torch at the destination or lights an entity on fire
- Animal - Spawns (randomly) a pig, cow, sheep, or chicken at the destination
- Teleport - Teleports you to the destination or a hit entity to a random destination
- Permissions:
NOTE: This refers to Bukkit permissions, not the Permissions plugin. There are no '*' nodes in the new system, so you cannot give a user 'multiarrow.*'.
You need to use the new Bukkit permissions system with this plugin. An excellent migration guide is available here. It will save you time and hassle down the road, as Permissions is no longer the safest, simplest way to protect your server.
- multiarrow.use.all - Allows users to use all arrow types (default: op)
- multiarrow.use.<name> - Allows users to use the <name> arrow type
- multiarrow.infinite - Infinite arrows! (default: false)
- multiarrow.free-fees - Skip iConomy fee check (default: op)
- multiarrow.free-materials - Skip extra material check (default: op)
- Configuration:
NOTE: If you are upgrading from MultiArrow v0.9.7 or earlier, please backup/delete your config.yml and allow MultiArrow to create a new one, as it has changed since then.
If you desire, you can require a user to pay one unit of a given item to use a given arrow type. To do this, simply edit your MultiArrow/config.yml using the template below as a guide. To add a new requirement, simply add a line with the arrow type name as the key and the type id of the item as the value. Currently, you may only set one id for a given arrow type. If you want to use colored wool or dyes for this purpose, append a colon and the data value and then wrap it in single quotes (e.g. '35:4' for yellow wool). If you omit the quotes, the colon will break your config file until it is removed or properly quoted.
requirements:
lightning: 348
explosive: 289
teleport: '35:4'
torch: 263
You can also add lines to the remove-arrow section of your config.yml to control which arrows are removed after their effect triggers. The default is true for all arrow types (i.e. all arrows are removed after the effect triggers), so you should only ever set something to false here. Here's an example that allows you to reuse teleport arrows (thanks twiclo!):
remove-arrows:
teleport: false
If you use iConomy 5.x, you can charge players a fee to fire a given arrow type. Note that you MUST include a decimal point with all costs ("50" is incorrect, "50.0" is correct). The following is an example of how to configure this feature:
fees:
teleport: 500.0
animal: 10.75
If you are using the fees functionality and would like the users to get a message containing their updated balance whenever a fee is charged, set the option below to true:
options:
send-balance-on-fee: true
Custom Arrow Types:
You can easily add your own arrow types with a few lines of Java code. Get a copy of my source code from GitHub and then add your own class to the package com.ayan4m1.multiarrow.arrows. For the sake of example, let's say we want to create a Chicken-spawning arrow.
public class ChickenArrowEffect implements ArrowEffect {
public void onEntityHitEvent(Arrow arrow, Entity target) { }
public void onGroundHitEvent(Arrow arrow) {
arrow.getWorld().spawnCreature(arrow.getLocation(), CreatureType.CHICKEN);
}
}
Then, add your class name to the ArrowType enum. For example, if "ChickenArrowEffect" were the name of our class, we would add the following to ArrowType:
public enum ArrowType {
NORMAL,
CHICKEN
}
The plugin will automatically provide that type name as an option to the user, and will dynamically instantiate and run your ArrowEffect onEntityHitEvent/onGroundHitEvent methods whenever a user fires one of your arrows.
If you have written a stable, interesting arrow type, reply here with a link to the source or submit a pull request from your personal fork to my GitHub repository.
Download/Source Code:
Source Code
评论 0
登录后参与评分
还没有评论,来抢沙发吧