1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2026-01-31 07:50:15 +00:00

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

View File

@@ -67,6 +67,6 @@ public enum UserLevel implements Predicate<CommandSourceStack>
Entity sender = source.getEntity();
return server.isDedicatedServer()
? source.getEntity() == null && source.hasPermission( 4 ) && source.getTextName().equals( "Server" )
: sender instanceof Player && ((Player) sender).getGameProfile().getName().equalsIgnoreCase( server.getServerModName() );
: sender instanceof Player player && player.getGameProfile().getName().equalsIgnoreCase( server.getServerModName() );
}
}