Fix first checkin
This commit is contained in:
parent
cbac3f24ce
commit
83d279b48d
@ -70,9 +70,18 @@ public class CheckinCommand implements CommandExecutor {
|
||||
ps.executeUpdate();
|
||||
double reward = getReward(streak);
|
||||
econ.depositPlayer(player, reward);
|
||||
player.sendMessage("§a签到成功!已连续签到§b" + streak + "§a天,获得§c$" + reward + "§c奖励");
|
||||
player.sendMessage("§a签到成功!已连续签到§b" + streak + "§a天,获得§c$" + reward + "§a奖励");
|
||||
ps.close();
|
||||
} else {
|
||||
player.sendMessage("§c未知错误。");
|
||||
ps = plugin.getConnection().prepareStatement(
|
||||
"INSERT INTO checkins(uuid,last_checkin,streak,total_checkin) VALUES(?,?,?,?)");
|
||||
ps.setLong(1, today.atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli());
|
||||
ps.setInt(2, 1);
|
||||
ps.setInt(3, 1);
|
||||
ps.setString(4, uuid.toString());
|
||||
ps.executeUpdate();
|
||||
player.sendMessage("§a签到成功!已连续签到§b1§a天,获得§c$100§a奖励");
|
||||
ps.close();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().severe(e.getMessage());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user