测试版
This commit is contained in:
parent
1e4e9a5e52
commit
ddbd2b4d4c
|
@ -64,6 +64,7 @@ public class PlayerData {
|
|||
yml.set("exp",this.exp.toString());
|
||||
yml.set("totalExp",this.totalExp.toString());
|
||||
saveFile();
|
||||
System.out.println("[调试 - 等级保存] level = "+this.level+" exp = "+this.exp+" totalExp = "+this.totalExp);
|
||||
}
|
||||
|
||||
public void saveFile(){
|
||||
|
|
|
@ -26,9 +26,10 @@ public class JoinEvent implements Listener {
|
|||
public void run() {
|
||||
FileConfiguration yml = Main.plugin.getConfig();
|
||||
int totalExp = yml.getInt("levelstats."+name+".totalExp");
|
||||
if(totalExp > playerData.getTotalExp().intValue()){
|
||||
DLevelAPI.setTotalExp(p,new BigInteger(yml.getString("levelstats."+name+".totalExp")));
|
||||
System.out.println("[调试 - 修正] 玩家 "+name+" 经验出现错误,已被纠正.");
|
||||
BigInteger bigInteger = BigInteger.valueOf(totalExp);
|
||||
if(bigInteger.compareTo(playerData.getTotalExp()) > 0){
|
||||
System.out.println("[调试 - 修正] 玩家 "+name+" 经验出现错误,已被纠正. YmlExp = "+bigInteger.toString()+" playerdata = "+playerData.getTotalExp().toString());
|
||||
DLevelAPI.setTotalExp(p,bigInteger);
|
||||
}
|
||||
}
|
||||
}.runTaskLater(Main.plugin,100L);
|
||||
|
@ -41,5 +42,6 @@ public class JoinEvent implements Listener {
|
|||
String uuid = p.getUniqueId().toString();
|
||||
PlayerData playerData = Main.serverManage.getPlayerData(uuid); // 读取玩家的等级数据
|
||||
playerData.savePlayerData();
|
||||
Main.serverManage.getDataHashMap().remove(p.getUniqueId().toString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
name: DemonLevels
|
||||
main: me.Demon.DemonLevels.Main
|
||||
version: 2.1.9
|
||||
version: 2.2.0
|
||||
depend: [DemonTeam]
|
||||
commands:
|
||||
dlevel:
|
Loading…
Reference in New Issue
Block a user