mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-25 20:15:50 +01:00
Add explicit cast from Yaml#load(String)
.
The version of SnakeYAML used in 1.8 land doesn't use a generic type parameter for the return value of `Yaml#load(String)`, so we have to do it manually on these old builds.
This commit is contained in:
parent
b2194480a9
commit
c500a17214
@ -27,7 +27,7 @@ public class FormulaMacros {
|
||||
String content = new String(bytes);
|
||||
|
||||
Yaml yaml = new Yaml();
|
||||
Map<?, ?> raw = yaml.load(content);
|
||||
Map<?, ?> raw = (Map<?, ?>) yaml.load(content);
|
||||
Map<String, Map<String, String>> converted = convert(raw);
|
||||
|
||||
macros.clear();
|
||||
|
@ -65,7 +65,7 @@ class SignDataMigrator {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Map<String, ?>> loadSignsInLegacyFile() throws IOException {
|
||||
byte[] bytes = Files.readAllBytes(legacyFile);
|
||||
Map<String, ?> map = yaml.load(new String(bytes));
|
||||
Map<String, ?> map = (Map<String, ?>) yaml.load(new String(bytes));
|
||||
if (map != null && map.containsKey("signs")) {
|
||||
List<Map<String, ?>> signs = (List<Map<String, ?>>) map.get("signs");
|
||||
if (signs != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user