More instanceof pattern matching

This commit is contained in:
Jonathan Coates
2021-11-28 15:58:30 +00:00
parent 095101831c
commit 2418cfb87b
18 changed files with 29 additions and 34 deletions
@@ -384,7 +384,7 @@ public final class Config
{
// Ensure file configs are reloaded. Forge should probably do this, so worth checking in the future.
CommentedConfig config = event.getConfig().getConfigData();
if( config instanceof CommentedFileConfig ) ((CommentedFileConfig) config).load();
if( config instanceof CommentedFileConfig loadable ) loadable.load();
sync();
}