mirror of
https://github.com/MiniDay/HamsterCurrency-Parent.git
synced 2025-08-23 04:35:30 +08:00
Compare commits
2 Commits
2.0.6-SNAP
...
2.0.7-SNAP
Author | SHA1 | Date | |
---|---|---|---|
e6d95e0ba9 | |||
ca220775b6 |
@@ -33,7 +33,7 @@
|
||||
<dependency>
|
||||
<groupId>cn.hamster3</groupId>
|
||||
<artifactId>HamsterCurrency</artifactId>
|
||||
<version>2.0.6-SNAPSHOT</version>
|
||||
<version>2.0.7-SNAPSHOT</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
group 'cn.hamster3'
|
||||
version '2.0.6-SNAPSHOT'
|
||||
version '2.0.7-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
|
@@ -45,14 +45,13 @@ public class PlayerData {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
public PlayerData(ConfigurationSection config) {
|
||||
uuid = UUID.fromString(config.getString("uuid"));
|
||||
OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
|
||||
if (player.getName() != null) {
|
||||
playerName = player.getName();
|
||||
} else {
|
||||
playerName = config.getString("playerName");
|
||||
playerName = config.getString("playerName").replace("\\'", "'");
|
||||
}
|
||||
playerCurrencies = new HashMap<>();
|
||||
ConfigurationSection playerCurrenciesConfig = config.getConfigurationSection("playerCurrencies");
|
||||
@@ -64,7 +63,7 @@ public class PlayerData {
|
||||
public JsonObject saveToJson() {
|
||||
JsonObject object = new JsonObject();
|
||||
object.addProperty("uuid", uuid.toString());
|
||||
object.addProperty("playerName", playerName);
|
||||
object.addProperty("playerName", playerName.replace("'", "\\'"));
|
||||
JsonObject playerCurrenciesJson = new JsonObject();
|
||||
for (Map.Entry<String, Double> entry : playerCurrencies.entrySet()) {
|
||||
playerCurrenciesJson.addProperty(entry.getKey(), entry.getValue());
|
||||
|
Reference in New Issue
Block a user