- 欢迎来到Minecraft插件百科!
- 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
- 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
PlayerPoints
翻译者注:此插件的API和Event部分的翻译,因为水平原因,无法完成,希望有经验的帮忙翻一下=A=
PlayerPoints
外文名 | PlayerPoints |
插件类型 | Spigot / CraftBukkit |
最新版本 | v2.1.3 |
兼容服务端 | 1.7.4-RO.1 |
前置插件 | - |
源地址 | 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: Whether or not to use the Votifier listener (Default: 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
Overview
The new API allows for developers to get feedback on whether or not transactions occurred. While you can still use the old methods of calling console commands, these methods will allow you to accomplish the same thing without having to go through console. In your plugin.yml, make sure to add your dependency on 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
All the methods in the API have JavaDocs. Here is a copy of that reference.
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 sends out events whenever a player's point amount will be modified. Events can be modified and cancelled.
PlayerPointsChangeEvent
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.
PlayerPointsResetEvent
Called when the player's points will be reset.
GitHub
点击此处去GitHub
相关插件
BossShop(官网地址) Karmiconomy(官网地址)