mirror of
https://e.coding.net/circlecloud/DataStorage.git
synced 2024-12-04 04:08:53 +00:00
添加操作提示...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
ba58149608
commit
a4812267a1
4
pom.xml
4
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>cn.citycraft</groupId>
|
||||
<artifactId>DataStorage</artifactId>
|
||||
<version>1.0</version>
|
||||
<version>1.0.1</version>
|
||||
<name>DataStorage</name>
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
@ -54,7 +54,7 @@
|
||||
</build>
|
||||
<properties>
|
||||
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
|
||||
<update.description></update.description>
|
||||
<update.description>§a添加操作提示...</update.description>
|
||||
<env.BUILD_NUMBER>Debug</env.BUILD_NUMBER>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
@ -36,22 +36,42 @@ public class DataStorage extends JavaPlugin {
|
||||
if (args.length > 2 && value != 0) {
|
||||
switch (subcmd) {
|
||||
case "add":
|
||||
db.dbUpdate(tableName, new KeyValue(vfields, value + dbValue), kv);
|
||||
if (db.dbUpdate(tableName, new KeyValue(vfields, value + dbValue), kv) != 0) {
|
||||
sender.sendMessage("§a成功给了 " + key + " 添加了 " + value + " 目前的值为 " + (value + dbValue));
|
||||
} else {
|
||||
sender.sendMessage("§c操作失败 请查看后台错误!");
|
||||
}
|
||||
return true;
|
||||
case "del":
|
||||
db.dbUpdate(tableName, new KeyValue(vfields, dbValue - value), kv);
|
||||
if (db.dbUpdate(tableName, new KeyValue(vfields, dbValue - value), kv) != 0) {
|
||||
sender.sendMessage("§a成功给了 " + key + " 减少了 " + value + " 目前的值为 " + (dbValue - value));
|
||||
} else {
|
||||
sender.sendMessage("§c操作失败 请查看后台错误!");
|
||||
}
|
||||
return true;
|
||||
case "create":
|
||||
db.dbInsert(tableName, kv.add(vfields, value));
|
||||
if (db.dbInsert(tableName, kv.add(vfields, value)) != 0) {
|
||||
sender.sendMessage("§a成功创建了 " + key + "初始值为 " + value);
|
||||
} else {
|
||||
sender.sendMessage("§c操作失败 请查看后台错误!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (args.length > 1) {
|
||||
db.dbDelete(tableName, kv);
|
||||
if (db.dbDelete(tableName, kv) != 0) {
|
||||
sender.sendMessage("§a成功移除了 " + key);
|
||||
} else {
|
||||
sender.sendMessage("§c操作失败 请查看后台错误!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
final String[] help = new String[] { "§6dd add key value 键key的值添加value!", "§6dd del key value 键key的值减少value!", "§6dd add key value 创建键key设置值为value!", "§6dd remove key 移除key!" };
|
||||
final String[] help = new String[] { "§6========= [§b" + this.getName() + "§6] 插件帮助列表=========",
|
||||
"§6/dd §acreate key value §6- §b创建键key设置值为value!",
|
||||
"§6/dd §aadd key value §6- §b键key的值添加value!",
|
||||
"§6/dd §adel key value §6- §b键key的值减少value!",
|
||||
"§6/dd §aremove key §6- §b移除key!" };
|
||||
sender.sendMessage(help);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user