Provide full verbosity for invalid components

This commit is contained in:
Alexander Brandes 2023-01-21 22:27:20 +01:00
parent c45bbe3ec5
commit 0558fcf5d5
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C

View File

@ -62,7 +62,7 @@ public class ComponentPreset implements ConfigurationSerializable {
public static ComponentPreset deserialize(final @NonNull Map<String, Object> map) {
final ClassicPlotManagerComponent classicPlotManagerComponent = ClassicPlotManagerComponent
.fromString(map.getOrDefault("component", "").toString()).orElseThrow(() ->
new IllegalArgumentException("The preset needs a valid target component"));
new IllegalArgumentException("The preset in components.yml needs a valid target component, got: " + map.get("component")));
final String pattern = map.getOrDefault("pattern", "").toString();
final double cost = Double.parseDouble(map.getOrDefault("cost", "0.0").toString());
final String permission = map.getOrDefault("permission", "").toString();