Add getters for before-ly-hooked fields

This commit is contained in:
Lucas
2019-06-09 23:39:06 +02:00
parent 9e504000eb
commit 6e497d3a4b
7 changed files with 45 additions and 16 deletions

View File

@@ -448,9 +448,7 @@ public class SpellbookPlugin extends Plugin
}
// CHECKSTYLE:OFF
Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>()
{
}.getType());
Collection<Spell> gson = GSON.fromJson(cfg, new TypeToken<List<Spell>>() {}.getType());
// CHECKSTYLE:ON
gson.stream().filter(Objects::nonNull).forEach(s -> spells.put(s.getWidget(), s));
@@ -465,7 +463,7 @@ public class SpellbookPlugin extends Plugin
private void saveSpells()
{
if (spells.isEmpty())
if (spells.isEmpty() || tmp == null || tmp.isEmpty())
{
return;
}