- 欢迎来到Minecraft插件百科!
- 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
- 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
PlayerPoints:修订间差异
跳转到导航
跳转到搜索
1582952890(留言 | 贡献) (→Mysql) |
(→特点) |
||
(未显示5个用户的27个中间版本) | |||
第1行: | 第1行: | ||
{{模板:待完善}} | |||
翻译者注:此插件的API和Event部分的翻译,因为水平原因,无法完成,希望有经验的帮忙翻一下=A= | |||
{{Bukkit Plugin Infobox | {{Bukkit Plugin Infobox | ||
|插件名=PlayerPoints | |插件名=PlayerPoints | ||
|版本=v2.1. | |版本=v2.1.4 | ||
|前置插件=- | |前置插件=- | ||
|兼容服务端版本=1. | |兼容服务端版本=1.9 | ||
|网址=http://dev.bukkit.org/bukkit-plugins/playerpoints/ | |网址=http://dev.bukkit.org/bukkit-plugins/playerpoints/ | ||
}} | }} | ||
== 概览 == | == 概览 == | ||
独立于其他经济插件的点券插件,可作为服务器第二款代币。作者将会增加一些不同的功能,如果你的点券数量足够,你便可以做这些 | |||
如果玩家做了一个不错的建筑,管理员便可以给玩家点券以奖励。 | |||
如果你的点券达到一定的数量,你将会成为管理员。 | |||
Development builds of this project can be acquired at the provided continuous integration server. (不太明白这句)<br /> 这些版本没有经过BukkitDev 的批准。需要构建者自己承担风险。 | |||
http://mineplugin.org/ChestCommandsGUI | |||
在正版服务器,这个插件将会连接到api.mojang.com来获取玩家的UUID。 | |||
=== 特点 === | === 特点 === | ||
:*可以给予玩家点券。 | |||
:*可以扣除玩家点券。 | |||
:*向玩家支付点券。 | |||
:*查看其他玩家点券数量 | |||
:*查看自己点券数量 | |||
:*排行榜 | |||
:*支持设置权限来限制。 | |||
:*可选Vault的支持 | |||
:*用点券来购买物品 ([http://dev.bukkit.org/bukkit-plugins/pointshop/ PointShop]) | |||
=== 命令 === | === 命令 === | ||
/points pay <玩家名字> <数量> | /points pay <玩家名字> <数量> 从你的账户内给予玩家点券。 | ||
/points give <玩家名字> <数量> 给予某个玩家点券。 | /points give <玩家名字> <数量> 给予某个玩家点券。 | ||
/points take <玩家名字> <数量> | /points take <玩家名字> <数量> 扣除某个玩家的点券。 | ||
/points set <玩家名字> <数量> 设置玩家的点券数量。 | /points set <玩家名字> <数量> 设置玩家的点券数量。 | ||
/points reset <玩家名字> | /points reset <玩家名字> 重置玩家的点券数量。 | ||
/points look <玩家名字> | /points look <玩家名字> 查看某个玩家的点券。 | ||
/points me | /points me 查看自己的点券数量。 | ||
/points lead [next/prev/#] | /points lead [next/prev/#] | ||
缩写: /p <give/take/look/me/pay/set/reset> | 缩写: /p <give/take/look/me/pay/set/reset> | ||
第69行: | 第71行: | ||
你可以在这里评论和投票所有的主题。 | 你可以在这里评论和投票所有的主题。 | ||
所有的改变都在这里实时呈现。 | 所有的改变都在这里实时呈现。 | ||
== Config(配置文件) == | == Config(配置文件) == | ||
'''以下选项将出现在Config.yml。''' | '''以下选项将出现在Config.yml。''' | ||
=== | === Storage: === | ||
这个选项将会定义数据的储存类型,储存方式通常有三种:MySQL、SQLite、YAML。注意这里一定要区分大小写。如果给的是一个无效的选项,将会以默认的YAML | 这个选项将会定义数据的储存类型,储存方式通常有三种:MySQL、SQLite、YAML。注意这里一定要区分大小写。如果给的是一个无效的选项,将会以默认的YAML | ||
方式处理(这个选项的默认是YMAL) | 方式处理(这个选项的默认是YMAL) | ||
=== vault: === | === vault: === | ||
这个选项定义了是否与Vault对接,请注意,任何其他的经济插件都会考虑这一个(这个选项默认的是false) | 这个选项定义了是否与Vault对接,请注意,任何其他的经济插件都会考虑这一个(这个选项默认的是false) | ||
=== version: === | === version: === | ||
这个选项用于标注此配置文件的版本,用于更新的时候使用,注意!请不要修改这个选项!! | 这个选项用于标注此配置文件的版本,用于更新的时候使用,注意!请不要修改这个选项!! | ||
=== Mysql === | |||
=== Mysql: === | |||
注意这段只有在storage:设置为 MySQL或SQLite的时候才生效 | 注意这段只有在storage:设置为 MySQL或SQLite的时候才生效 | ||
*host:数据库的(ip)地址(这个选项默认参数是localhost) | |||
*port: 数据库的端口(这个选项默认参数是3306) | |||
*database: 数据库名称(这个选项默认参数是minecraft) | |||
*user:登录数据库所使用的用户名(这个选项的默认参数是root) | |||
*password:登录数据库所使用的密码(这个选项的默认参数是pass) | |||
'''其他的一些设置:''' | '''其他的一些设置:''' | ||
'' | *use:如果你想设置使用数据库,请设置这项为true(这个选项的默认参数是false) | ||
=== vote: === | |||
*enabled: 是否使用Votifier监听器(默认: false) | |||
*amount: Amount of points to give on a vote event (Default: 100) | |||
*online: Whether the player must be online to receive the points (Default: false) | |||
=== debug: === | |||
*database: 开启数据库连接的报错显示(这个选项的默认参数是false) | |||
== API == | |||
=== 概述 === | |||
新的API允许开发人员对是否交易得到反馈.而你仍然可以使用旧的方法调用 | |||
控制台命令,这些方法可以让你完成同样的事情,而不必通过控制台. | |||
在你的plugin.yml中,确保PlayerPoints添加依赖关系. | |||
Either: | |||
*depend: [PlayerPoints] | |||
Or: | |||
*softdepend: [PlayerPoints] | |||
During enable, you need to grab the PlayerPoints plugin instance and save that reference somewhere as you will be using the API through it. | |||
<source lang="Java"> | |||
import org.black_ixx.playerpoints.PlayerPoints; | |||
private PlayerPoints playerPoints; | |||
/** | |||
* Validate that we have access to PlayerPoints | |||
* | |||
* @return True if we have PlayerPoints, else false. | |||
*/ | |||
private boolean hookPlayerPoints() { | |||
final Plugin plugin = this.getServer().getPluginManager().getPlugin("PlayerPoints"); | |||
playerPoints = PlayerPoints.class.cast(plugin); | |||
return playerPoints != null; | |||
} | |||
/** | |||
* Accessor for other parts of your plugin to retrieve PlayerPoints. | |||
* | |||
* @return PlayerPoints plugin instance | |||
*/ | |||
public PlayerPoints getPlayerPoints() { | |||
return playerPoints; | |||
} | |||
</source> | |||
If its not enabled, you're going to have to handle that situation accordingly. | |||
-If it is enabled, then utilizing the API is rather simple. You don't need to get an instance, or hold onto some object. All you have to do | |||
is call the method from static class.- The static access of the API had to be changed in order to service situations where multiple linked | |||
servers are referencing the same MySQL table. | |||
Now, you access the API through the plugin instance that we saved earlier. All the methods of the API are the same as before. | |||
Example: | |||
<source lang="Java"> | |||
int balance = playerPoints.getAPI().look("Player"); | |||
The above code will return the amount of points that the player named "Player" has. | |||
</source> | |||
Another example: | |||
<source lang="Java"> | |||
if(playerPoints.getAPI().take("Player", 100)) { | |||
//Success | |||
} else { | |||
//Failed, probably not enough points | |||
} | |||
</source> | |||
The above code attempts to take 100 points away from the player "Player". As mentioned before, you get feedback on the operation on whether or | |||
not it succeeded in performing the transaction. | |||
=== JavaDocs === | |||
该API中的所有方法都有JavaDoc.以下是引用的副本. | |||
give(String playername, int amount) | |||
Gives points to specified player | |||
Returns: true if we successfully adjusted points, else false | |||
take(String playername, int amount) | |||
Take points from specified player. If amount given is not already negative, it is done internally. | |||
Returns: true if they had enough points to be removed, else false. | |||
look(String playername) | |||
Look up the current points of a player, if available. If the player is not in the config file, we default to 0. | |||
Returns: integer of the amount of points the player has | |||
pay(String sorce, String target, int amount) | |||
Transfer points from one player to another. Attempts to take the points, if available, from the source player account and then attempts | |||
to give that amount to the target player account. If the give portion fails, the amount taken is returned to the source player account. | |||
Returns: true if the transfer succeeded, else false. | |||
set(String playername, int amount) | |||
Sets a player's points to the given value. This overwrites whatever current amount they had before. | |||
Returns true if successful, else false. | |||
reset(String playername) | |||
Removes the player from the config, effectively removing the points that the player had. | |||
Returns true if successful, else false. | |||
== Event == | |||
每当玩家点券数量被修改PlayerPoints将发出事件. | |||
事件可以进行修改与取消. | |||
=== 玩家点券更改事件 === | |||
Called when the player's points will be changed. You get the name of the target player and the amount that it will change by. | |||
当玩家的点会被改变。得到目标玩家的名称和数量,它将会改变。 | |||
=== 玩家点券重置事件 === | |||
Called when the player's points will be reset. | |||
当玩家的点数将被重新设置。 | |||
== GitHub == | |||
[https://github.com/Mitsugaru/PlayerPoints/ 点击此处去GitHub] | |||
== 相关插件 == | |||
[http://dev.bukkit.org/bukkit-plugins/bossshop/ BossShop(官网地址)] | |||
[http://dev.bukkit.org/bukkit-plugins/karmiconomy/ Karmiconomy(官网地址)] | |||
[[Category:经济]] | |||
[[Category:修正]] |
2016年11月18日 (五) 03:06的最新版本
翻译者注:此插件的API和Event部分的翻译,因为水平原因,无法完成,希望有经验的帮忙翻一下=A=
PlayerPoints
外文名 | PlayerPoints |
插件类型 | Spigot / CraftBukkit |
最新版本 | v2.1.4 |
兼容服务端 | 1.9 |
前置插件 | - |
源地址 | http://dev.bukkit.org/bukkit-plugins/playerpoints/ |
概览
独立于其他经济插件的点券插件,可作为服务器第二款代币。作者将会增加一些不同的功能,如果你的点券数量足够,你便可以做这些 如果玩家做了一个不错的建筑,管理员便可以给玩家点券以奖励。 如果你的点券达到一定的数量,你将会成为管理员。 Development builds of this project can be acquired at the provided continuous integration server. (不太明白这句)
这些版本没有经过BukkitDev 的批准。需要构建者自己承担风险。 http://mineplugin.org/ChestCommandsGUI 在正版服务器,这个插件将会连接到api.mojang.com来获取玩家的UUID。
特点
- 可以给予玩家点券。
- 可以扣除玩家点券。
- 向玩家支付点券。
- 查看其他玩家点券数量
- 查看自己点券数量
- 排行榜
- 支持设置权限来限制。
- 可选Vault的支持
- 用点券来购买物品 (PointShop)
命令
/points pay <玩家名字> <数量> 从你的账户内给予玩家点券。 /points give <玩家名字> <数量> 给予某个玩家点券。 /points take <玩家名字> <数量> 扣除某个玩家的点券。 /points set <玩家名字> <数量> 设置玩家的点券数量。 /points reset <玩家名字> 重置玩家的点券数量。 /points look <玩家名字> 查看某个玩家的点券。 /points me 查看自己的点券数量。 /points lead [next/prev/#] 缩写: /p <give/take/look/me/pay/set/reset>
权限
PlayerPoints.pay 这个权限将会允许你使用pay指令。 PlayerPoints.give 这个权限将会允许你使用give指令。 PlayerPoints.take 这个权限将会允许你使用take指令。 PlayerPoints.set 这个权限将会允许你使用set指令。 PlayerPoints.reset 这个权限将会允许你使用reset指令。 PlayerPoints.look 这个权限将会允许你使用look指令。 PlayerPoints.lead 这个权限将会允许你使用lead指令。 PlayerPoints.me 这个权限将会允许你使用me指令。
视频
请前去官网进行观看
待办事项
得到各国语言的支持。
Maven
我们支持Maven,只需添加我们的存储库。
<repository>
<id>dakani</id>
<name>Dakani Nexus Repo</name>
<url>http://repo.dakanilabs.com/content/repositories/public</url>
</repository>
在依赖中加入PlayerPoints。
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>PlayerPoints</artifactId>
<version>2.1.3</version>
</dependency>
Trello开发板 访问 Trello开发板查看所有项目和待办的事项。 你可以在这里评论和投票所有的主题。 所有的改变都在这里实时呈现。
Config(配置文件)
以下选项将出现在Config.yml。
Storage:
这个选项将会定义数据的储存类型,储存方式通常有三种:MySQL、SQLite、YAML。注意这里一定要区分大小写。如果给的是一个无效的选项,将会以默认的YAML 方式处理(这个选项的默认是YMAL)
vault:
这个选项定义了是否与Vault对接,请注意,任何其他的经济插件都会考虑这一个(这个选项默认的是false)
version:
这个选项用于标注此配置文件的版本,用于更新的时候使用,注意!请不要修改这个选项!!
Mysql:
注意这段只有在storage:设置为 MySQL或SQLite的时候才生效
*host:数据库的(ip)地址(这个选项默认参数是localhost) *port: 数据库的端口(这个选项默认参数是3306) *database: 数据库名称(这个选项默认参数是minecraft) *user:登录数据库所使用的用户名(这个选项的默认参数是root) *password:登录数据库所使用的密码(这个选项的默认参数是pass) 其他的一些设置: *use:如果你想设置使用数据库,请设置这项为true(这个选项的默认参数是false)
vote:
*enabled: 是否使用Votifier监听器(默认: false) *amount: Amount of points to give on a vote event (Default: 100) *online: Whether the player must be online to receive the points (Default: false)
debug:
*database: 开启数据库连接的报错显示(这个选项的默认参数是false)
API
概述
新的API允许开发人员对是否交易得到反馈.而你仍然可以使用旧的方法调用 控制台命令,这些方法可以让你完成同样的事情,而不必通过控制台. 在你的plugin.yml中,确保PlayerPoints添加依赖关系. Either: *depend: [PlayerPoints] Or: *softdepend: [PlayerPoints] During enable, you need to grab the PlayerPoints plugin instance and save that reference somewhere as you will be using the API through it.
import org.black_ixx.playerpoints.PlayerPoints;
private PlayerPoints playerPoints;
/**
* Validate that we have access to PlayerPoints
*
* @return True if we have PlayerPoints, else false.
*/
private boolean hookPlayerPoints() {
final Plugin plugin = this.getServer().getPluginManager().getPlugin("PlayerPoints");
playerPoints = PlayerPoints.class.cast(plugin);
return playerPoints != null;
}
/**
* Accessor for other parts of your plugin to retrieve PlayerPoints.
*
* @return PlayerPoints plugin instance
*/
public PlayerPoints getPlayerPoints() {
return playerPoints;
}
If its not enabled, you're going to have to handle that situation accordingly.
-If it is enabled, then utilizing the API is rather simple. You don't need to get an instance, or hold onto some object. All you have to do is call the method from static class.- The static access of the API had to be changed in order to service situations where multiple linked servers are referencing the same MySQL table.
Now, you access the API through the plugin instance that we saved earlier. All the methods of the API are the same as before. Example:
int balance = playerPoints.getAPI().look("Player");
The above code will return the amount of points that the player named "Player" has.
Another example:
if(playerPoints.getAPI().take("Player", 100)) {
//Success
} else {
//Failed, probably not enough points
}
The above code attempts to take 100 points away from the player "Player". As mentioned before, you get feedback on the operation on whether or not it succeeded in performing the transaction.
JavaDocs
该API中的所有方法都有JavaDoc.以下是引用的副本.
give(String playername, int amount) Gives points to specified player Returns: true if we successfully adjusted points, else false take(String playername, int amount) Take points from specified player. If amount given is not already negative, it is done internally. Returns: true if they had enough points to be removed, else false. look(String playername) Look up the current points of a player, if available. If the player is not in the config file, we default to 0. Returns: integer of the amount of points the player has pay(String sorce, String target, int amount) Transfer points from one player to another. Attempts to take the points, if available, from the source player account and then attempts to give that amount to the target player account. If the give portion fails, the amount taken is returned to the source player account. Returns: true if the transfer succeeded, else false. set(String playername, int amount) Sets a player's points to the given value. This overwrites whatever current amount they had before. Returns true if successful, else false. reset(String playername) Removes the player from the config, effectively removing the points that the player had. Returns true if successful, else false.
Event
每当玩家点券数量被修改PlayerPoints将发出事件. 事件可以进行修改与取消.
玩家点券更改事件
Called when the player's points will be changed. You get the name of the target player and the amount that it will change by. 当玩家的点会被改变。得到目标玩家的名称和数量,它将会改变。
玩家点券重置事件
Called when the player's points will be reset. 当玩家的点数将被重新设置。
GitHub
点击此处去GitHub
相关插件
BossShop(官网地址) Karmiconomy(官网地址)