1
0
mirror of https://e.coding.net/circlecloud/JumpPlate.git synced 2024-11-23 02:08:49 +00:00

设置跳板高度后自动保存...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2016-02-23 20:53:50 +08:00
parent 1fd9b9ed1d
commit ea5edce65b
3 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@
}
# -----保护注解命令方法不被清理-----
-keepclassmembers class **.commands.HandlerCommand { <methods>; }
-keepclassmembers class * implements **.commands.HandlerCommands
{
@**.commands.HandlerCommand <methods>;

View File

@ -31,6 +31,6 @@ public class JumpPlate extends JavaPlugin implements Listener, HandlerCommands {
public void onLoad() {
config = new FileConfig(this);
pluginname = config.getMessage("pluginname");
removedamage = JumpPlate.instence.getConfig().getBoolean("removedamage");
removedamage = config.getBoolean("removedamage");
}
}

View File

@ -18,11 +18,12 @@ public class JumpPlateCommand implements HandlerCommands {
e.getSender().sendMessage(JumpPlate.instence.pluginname + "§a配置文件已重载!");
}
@HandlerCommand(name = "set", description = "设置基岩跳板高度", minimumArguments = 1, onlyPlayerExecutable = true, permission = "JumpPlate.reload", possibleArguments = "<跳板高度(1-10)>")
@HandlerCommand(name = "set", description = "设置基岩跳板高度", minimumArguments = 1, permission = "JumpPlate.reload", possibleArguments = "<跳板高度(1-10)>")
public void setCommand(final InvokeCommandEvent e) {
try {
final double drb = Double.parseDouble(e.getArgs()[0]);
JumpPlate.instence.getConfig().set("BEDROCK", drb);
JumpPlate.instence.getConfig().save();
e.getSender().sendMessage(JumpPlate.instence.pluginname + "§a基岩的跳板弹跳倍数已设置为 " + drb + "倍!");
} catch (final NumberFormatException ex) {
e.getSender().sendMessage(JumpPlate.instence.pluginname + "§c参数非法 请输入数字 1-10");