Proper exception handling when not able to load player data file
This commit is contained in:
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeMap;
|
||||
import java.util.UUID;
|
||||
import java.util.function.IntUnaryOperator;
|
||||
|
||||
/**
|
||||
@@ -362,4 +363,14 @@ public record PlayerDataWrapper(CompoundTag data) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static class PlayerDataLoadException extends RuntimeException {
|
||||
public PlayerDataLoadException(String playerName, UUID playerId, Throwable cause) {
|
||||
super("Unable to load data of player " + playerName + " (" + playerId + ")", cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user