mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-19 13:51:22 +01:00
Close the command scanner once stopped
This commit is contained in:
parent
224626bdbd
commit
a574c1fe2a
@ -61,6 +61,7 @@ public final class CommandManager {
|
||||
execute(consoleSender, command);
|
||||
}
|
||||
}
|
||||
scanner.close();
|
||||
}, "ConsoleCommand-Thread");
|
||||
consoleThread.setDaemon(true);
|
||||
consoleThread.start();
|
||||
|
@ -21,7 +21,7 @@ public class DataImpl implements Data {
|
||||
protected final ConcurrentHashMap<String, Class> dataType = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
public <T> void set(@NotNull String key, @Nullable T value, @Nullable Class<T> type) {
|
||||
public synchronized <T> void set(@NotNull String key, @Nullable T value, @Nullable Class<T> type) {
|
||||
if (value != null) {
|
||||
this.data.put(key, value);
|
||||
this.dataType.put(key, type);
|
||||
|
@ -86,9 +86,11 @@ public class PlayerSkin {
|
||||
final String url = "https://api.mojang.com/users/profiles/minecraft/" + username;
|
||||
|
||||
try {
|
||||
// Retrieve the mojang uuid from the name
|
||||
final String response = URLUtils.getText(url);
|
||||
final JsonObject jsonObject = JsonParser.parseString(response).getAsJsonObject();
|
||||
final String uuid = jsonObject.get("id").getAsString();
|
||||
// Retrieve the skin data from the mojang uuid
|
||||
return fromUuid(uuid);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user