ClassSign
源码
功能
- 创建告示牌,当被击打时,会根据职业从预设物品中填充你的背包/盔甲。
- 自定义你的职业!
- 作为管理员(op),可以实时禁用/启用告示牌。
- 可以选择在给予物品前清空显示的背包、整个背包,或者不清空。
- 可以选择是否覆盖当前穿戴的盔甲。
- 既可以给予物品,也可以给予盔甲,或者两者都给予!
- 设置告示牌只能使用一次!这些设置会在重载后保留,因此玩家在服务器重载后将无法再次使用已用过的告示牌。
- 清除用户的告示牌使用记录!
简介
此插件允许你创建告示牌,通过基于职业系统的配置,将预设物品填充到你的背包中。它还可以让你用预设物品替换盔甲。拥有相应权限(如果未找到权限节点则为管理员)的人可以通过右键点击告示牌来实时禁用或启用它们。要使用告示牌,请左键点击(击打)它。
你还可以创建一次性告示牌,每个玩家只能使用一次。
注意:此插件还会在其配置文件夹中创建一个名为 signs.dat 的文件。请勿编辑或删除此文件
如果你拥有正确的权限(或者是管理员),你可以按以下方式放置职业告示牌:
[Class]
<class_name>
<blank>
<blank>
要创建一次性告示牌,请使用以下模板:
[Class]
<class_name>
[One-Use]
<blank>
如果设置正确,第四行应该会变为绿色的 [Active] 标签。
阅读下方的配置部分以了解如何定义职业。
截图
请参阅图片选项卡。
待办事项
- (可能)在使用告示牌时更改权限组?
- 添加经济系统支持。
- 添加 Permissions 节点以保护某些玩家免受一次性告示牌模式的影响。
如果你有任何建议,请在下方发布,我可能会考虑实现它们!
设置
配置文件 properties.yml 将以默认值创建,如下所示:
classes:
Chef:
items: 39:10,40:10,281:10
Knight:
items: 267,320:5
armor: 306,307,308,309
Archer:
items: 261,262:50,297:4
armor: 298,299,300,301
Armored:
armor: 302,303,304,305
Builder:
items: 44:64,44@2:64,44@3:64,44@4:64,44@5:64
overwriteArmor: true
emptyInventory: false
emptyWholeInventory: false
- classes - 这里是所有职业定义发生的地方。遵循默认指南,你可以指定自己的职业。请注意,缩进时使用四个空格(不要使用制表符)。
- Chef, Knight, Archer, Armored - 这些是示例职业,每个都有不同的物品/盔甲定义。例如,Chef 获得 10 个棕色蘑菇、10 个红色蘑菇和 10 个木碗。Chef 没有盔甲(如果 overwriteArmor 开启,他们的盔甲会被移除)。
Knight 获得一把铁剑和 5 个熟猪肉排。Knight 还获得一套完整的铁盔甲。
Armored 职业获得一套完整的锁子甲。Armored 职业不获得任何物品(但如果 emptyInventory 开启,背包仍会被清空。)
要定义物品/盔甲,请使用 Block ID,可以通过访问 并搜索方块名称来获取。要定义数量,请使用冒号,然后是数量。不要在盔甲定义中使用数量。盔甲定义必须按照以下顺序:头盔、胸甲、护腿、靴子。如果你想省略某个盔甲部件,定义一个 0(零)(例如 0,303,304,305 将给予全套锁子甲,除了头盔。)
overwriteArmor - 当设置为 true 时,玩家的旧盔甲会被移除,然后给予新盔甲(如果适用)。否则,给予的盔甲将填补任何“空缺”。(例如,如果玩家已经戴着皮革头盔,并选择了 Armored 职业,他们将保留皮革头盔,并获得锁子甲胸甲、护腿和靴子。)
Builder 职业获得每种可能的板条箱各 64 个。这展示了如何在物品中使用数据值(Data Values)。
- emptyInventory - 当设置为 true 时,底部的 9 个背包槽位(始终显示的那部分)将在给予物品前被清空。否则,物品将叠加在这些槽位上。
- checkVersion - 当设置为 true 时,插件将在每次加载/重载时执行简单的版本检查,并在有更新可用时向控制台报告。当设置为 false 时,此检查将被禁用。
- emptyWholeInventory - 当设置为 true 时,玩家的全部背包将被清空。此选项会覆盖 emptyInventory。如果 emptyInventory 设置为 false,但此项设置为 true,整个背包仍会被清空。
权限
这些权限节点适用于 Permissions 2.x 或 Bukkit SuperPerms。使用 SuperPerms 时,任何管理员权限以及启用/禁用权限将默认为 op 检查,任何其他节点将对所有人默认为 true。
- classign.user.place - 允许玩家/组放置 Class Signs。
- classign.user.use - 允许玩家/组使用告示牌。
- classign.admin.toggle - 允许玩家/组通过右键点击在激活和非激活状态之间切换告示牌。
- classign.admin.clearuser - 允许玩家/组使用清除用户告示牌使用历史的命令。
- classign.admin.add - 允许玩家/组通过命令添加职业。
- classign.admin.remove - 允许玩家/组通过命令移除职业。
- classign.admin.items - 允许玩家/组通过命令更改职业的物品输出。
- classign.admin.armor - 允许玩家/组通过命令更改职业的护甲输出。
命令
对于以下列出的所有命令,您可以使用 /cs、/classsign 或 /classign。
此命令清除指定用户的告示牌使用历史,允许他/她在启用一次性使用模式的情况下重新使用之前用过的告示牌。
需要权限:classign.admin.clearuser
此命令将指定的职业添加到配置文件中。它不允许您添加重复的职业。
需要权限:classign.admin.add
此命令从配置文件中移除指定的职业。此操作不可逆。它不允许您移除不存在的职业。
需要权限:classign.admin.items OR classsign.admin.armor - 取决于具体使用的命令
- /cs class items/armor <职业名称> <值>
此命令允许您更改职业的物品或护甲输出。请注意,您*必须*遵循与配置文件中相同的规则。对于物品,您必须定义它们,中间没有空格,仅用逗号分隔。对于护甲,您不能定义数量,并且必须有4个值,按从上到下的顺序排列。
需要权限:classign.admin.items OR classsign.admin.armor - 取决于具体使用的命令
ClassSign
SOURCE
Features
- Create signs that, when punched, will fill your inventory/armor with pre-defined items based on classes.
- Define your own classes!
- As an op, disable/enable signs on the fly.
- Choose to clear the shown inventory, or whole inventory, before giving items, or not at all.
- Choose to overwrite the currently worn armor, or not.
- Give either items, armor, or both!
- Make it so that a sign can only be used once! These settings persist through reload, so players will not be able to use signs they've previously used after a server reload.
- Clear a user's sign usage history!
Summary
This plugin allows you to create signs which will allow you to fill your inventory with pre-configured items based on a class system. It will also allow you to replace Armor with pre-defined items. Anybody with the correct permissions (or if permissions isn't found - an op) can disable/enable signs on the fly, by right clicking the sign. To use the sign, punch it (left click).
You can also create a one-use sign, which can only be used by each player once.
Note: This plugin will also create a file called signs.dat in it's configuration folder. Do not edit this file, or delete it
If you have the correct permissions (or if you're an op), you can place class signs like so:
[Class]
<class_name>
<blank>
<blank>
To create a One-Use sign, use this template:
[Class]
<class_name>
[One-Use]
<blank>
If done correctly, the 4th line should change to a green [Active] tag.
Read the Configuration section below to find out how to define classes.
Screenshots
See images tab.
To-Do
- (possibly) change permission group when a sign is used?
- Add economy support.
- Add Permissions node to protect certain players from one use sign mode.
If you have any suggestions, post them below and I may choose to implement it!
Settings
The configuration file properties.yml will be created with default values as shown below:
classes:
Chef:
items: 39:10,40:10,281:10
Knight:
items: 267,320:5
armor: 306,307,308,309
Archer:
items: 261,262:50,297:4
armor: 298,299,300,301
Armored:
armor: 302,303,304,305
Builder:
items: 44:64,44@2:64,44@3:64,44@4:64,44@5:64
overwriteArmor: true
emptyInventory: false
emptyWholeInventory: false
- classes - this is where all the class definition takes place. Following the default guidelines, you can specify your own class. Please note, when indenting, use FOUR SPACES (not tabs).
- Chef, Knight, Archer, Armored - these are sample classes, each with different item/armor definitions. For example, the Chef gets 10 brown mushrooms, 10 red mushrooms, and 10 wooden bowls. The Chef gets no armor (and if overwriteArmor is on, their armor is removed).
The Knight gets an Iron sword and 5 cooked porkchops. The Knight also gets a full set of Iron armor.
The Armored class gets a full set of Chainmail Armor. The Armored class gets no items (but if emptyInventory is on, the inventory is still cleared.)
To define items/armor, use the Block IDs that can be found using and searching the block name. To define an amount, use a colon, then the amount. Do NOT use amounts on Armor definitions. Armor definitions MUST be in this order: Helmet, Chestplate, Leggings, Boots. If you want to omit an Armor part, define a 0 (zero) (e.g. 0,303,304,305 will give full chainmail, except a helmet.)
overwriteArmor - when set to true, the player's previous armor is removed, and then the new armor (if applicable) is given. Otherwise, the given armor will fill any "gaps." (e.g. if a player is already wearing a leather helmet, and selects the Armored class, they will keep their leather helmet, and be given Chainmail chestplate, leggings and boots.)
The Builder class gets 64 of every possible slab. This shows how to use Data Values in items.
- emptyInventory - when set to true, the bottom 9 inventory slots (the ones always on show) will be cleared before items are given. Otherwise, items are given on top of this.
- checkVersion - when set to true, the plugin will perform a simple version check at every load/reload, and will report to the console when an update is available. When set to false, this check is disabled.
- emptyWholeInventory - when set to true, the player's whole inventory is cleared. This option OVERRIDES emptyInventory. If emptyInventory is set to false, but this is set to true, the whole inventory will still empty.
Permissions
These permission nodes will work with either Permissions 2.x, or Bukkit SuperPerms. When using SuperPerms, any admin permissions - and enable/disable permissions - will default to an op check, any other nodes will default to true for everyone.
- classign.user.place - allows the player/group to place Class Signs.
- classign.user.use - allows the player/group to use a sign.
- classign.admin.toggle - allows the player/group to toggle a sign between active and inactive by right-clicking.
- classign.admin.clearuser - allows the player/group to use the command that clears a user's sign usage history.
- classign.admin.add - allows the player/group to add a class using commands.
- classign.admin.remove - allows the player/group to remove a class using commands.
- classign.admin.items - allows the player/group to change the item output of a class using commands.
- classign.admin.armor - allows the player/group to change the armor output of a class using commands.
Commands
For all commands listed below, you can either use /cs, /classsign, or /classign.
This command clears the specified user's sign usage history, allowing him/her to re-use signs they've used before, even if one use sign mode is enabled.
Requires Permission: classign.admin.clearuser
- /cs class add <class name>
This command adds the specified class to the config file. It will not let you add a duplicate class.
Requires Permission: classign.admin.add
- /cs class remove <class name>
This command removes the specified class from the config file. This is irreversible. It will not let you remove a non-existant class.
Requires Permission: classign.admin.remove
- /cs class items/armor <class name> <values>
This command lets you change the item or armor output of a class. Please note, you *must* follow the same rules as in the configuration file. For items, you must define them with no spaces inbetween, just commas. For armor, you must not define an amount, and you must have 4 values, in top to bottom order.
Requires Permission: classign.admin.items OR classsign.admin.armor - depending on which command
评论 0
登录后参与评分
还没有评论,来抢沙发吧