配置写入文件

This commit is contained in:
雪风 2025-03-12 15:23:03 +08:00
parent 86ce3af7c8
commit 92f4e04cd0
3 changed files with 12 additions and 10 deletions

View File

@ -597,8 +597,8 @@ public class PlayerStats implements Serializable {
} }
} }
double bl = 0; int bl = 0;
double jb = 0; int jb = 0;
if (Start.blkg == 1){ if (Start.blkg == 1){
for (BlConfig blConfig : Start.BLlist) { for (BlConfig blConfig : Start.BLlist) {
if (blConfig.isInTimeRange()){ if (blConfig.isInTimeRange()){
@ -619,8 +619,8 @@ public class PlayerStats implements Serializable {
} }
} }
} }
this.dropMod+= bl; this.dropMod+= bl/100;
this.cashMod+= jb; this.cashMod+= jb/100;

View File

@ -6,8 +6,8 @@ import cn.hutool.core.date.DateUtil;
public class BlConfig { public class BlConfig {
int item_id; int item_id;
double gold_rate; int gold_rate;
double item_rate; int item_rate;
String time_range; String time_range;
@ -22,19 +22,19 @@ public class BlConfig {
this.item_id = item_id; this.item_id = item_id;
} }
public double getGold_rate() { public int getGold_rate() {
return gold_rate; return gold_rate;
} }
public void setGold_rate(double gold_rate) { public void setGold_rate(int gold_rate) {
this.gold_rate = gold_rate; this.gold_rate = gold_rate;
} }
public double getItem_rate() { public int getItem_rate() {
return item_rate; return item_rate;
} }
public void setItem_rate(double item_rate) { public void setItem_rate(int item_rate) {
this.item_rate = item_rate; this.item_rate = item_rate;
} }

View File

@ -1036,6 +1036,7 @@ public class 特殊控制台 extends JFrame {
//转json //转json
JSONObject jsonObject1 = JSONObject.parseObject(result3); JSONObject jsonObject1 = JSONObject.parseObject(result3);
Start.blkg = jsonObject1.getInteger("open"); Start.blkg = jsonObject1.getInteger("open");
Start.bossxw = jsonObject1.getInteger("bossxw");
Start.bldj = jsonObject1.getInteger("stackable"); Start.bldj = jsonObject1.getInteger("stackable");
Start.BLlist = jsonObject1.getJSONArray("gold_and_item_drop_rates").toJavaList(BlConfig.class); Start.BLlist = jsonObject1.getJSONArray("gold_and_item_drop_rates").toJavaList(BlConfig.class);
@ -1069,6 +1070,7 @@ public class 特殊控制台 extends JFrame {
JSONObject jsonObject1 = new JSONObject(); JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("open", Start.blkg); jsonObject1.put("open", Start.blkg);
jsonObject1.put("stackable", Start.bldj); jsonObject1.put("stackable", Start.bldj);
jsonObject1.put("bossxw", Start.bossxw);
jsonObject1.put("gold_and_item_drop_rates", Start.BLlist); jsonObject1.put("gold_and_item_drop_rates", Start.BLlist);
jsonObject1.put("bskg", Start.bskg); jsonObject1.put("bskg", Start.bskg);