mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Migrate 'EntityUtil#capNumeral' to an enhanced switch (#4195)
* Migrate 'EntityUtil#capNumeral' to an enhanced switch * Apply feedback
This commit is contained in:
parent
5f7bb784f0
commit
fc783574a3
@ -42,28 +42,14 @@ public class EntityUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int capNumeral(final @NonNull String flagName) {
|
private static int capNumeral(final @NonNull String flagName) {
|
||||||
int i;
|
return switch (flagName) {
|
||||||
switch (flagName) {
|
case "mob-cap" -> CAP_MOB;
|
||||||
case "mob-cap":
|
case "hostile-cap" -> CAP_MONSTER;
|
||||||
i = CAP_MOB;
|
case "animal-cap" -> CAP_ANIMAL;
|
||||||
break;
|
case "vehicle-cap" -> CAP_VEHICLE;
|
||||||
case "hostile-cap":
|
case "misc-cap" -> CAP_MISC;
|
||||||
i = CAP_MONSTER;
|
default -> CAP_ENTITY;
|
||||||
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;
|
|
||||||
}
|
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
Loading…
Reference in New Issue
Block a user