mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 12:46:46 +01:00
Migrate 'EntityUtil#capNumeral' to an enhanced switch
This commit is contained in:
parent
a3bc3968a5
commit
f5972317bd
@ -42,27 +42,14 @@ public class EntityUtil {
|
||||
}
|
||||
|
||||
private static int capNumeral(final @NonNull String flagName) {
|
||||
int i;
|
||||
switch (flagName) {
|
||||
case "mob-cap":
|
||||
i = CAP_MOB;
|
||||
break;
|
||||
case "hostile-cap":
|
||||
i = CAP_MONSTER;
|
||||
break;
|
||||
case "animal-cap":
|
||||
i = CAP_ANIMAL;
|
||||
break;
|
||||
case "vehicle-cap":
|
||||
i = CAP_VEHICLE;
|
||||
break;
|
||||
case "misc-cap":
|
||||
i = CAP_MISC;
|
||||
break;
|
||||
case "entity-cap":
|
||||
default:
|
||||
i = CAP_ENTITY;
|
||||
}
|
||||
int i = switch (flagName) {
|
||||
case "mob-cap" -> CAP_MOB;
|
||||
case "hostile-cap" -> CAP_MONSTER;
|
||||
case "animal-cap" -> CAP_ANIMAL;
|
||||
case "vehicle-cap" -> CAP_VEHICLE;
|
||||
case "misc-cap" -> CAP_MISC;
|
||||
default -> CAP_ENTITY;
|
||||
};
|
||||
return i;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user