File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
PacketWrapper/src/main/java/com/comphenix/packetwrapper/util Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1414public final class EntityUtil {
1515
1616 private static final int MINOR_VERSION ;
17- private static final Map <EntityType , Integer > ENTITY_TYPE_IDS ;
18- private static final Map <Integer , EntityType > ENTITY_TYPES ;
17+ private static final Map <@ NotNull EntityType , @ NotNull Integer > ENTITY_TYPE_IDS ;
18+ private static final Map <@ NotNull Integer , @ NotNull EntityType > ENTITY_TYPES ;
1919
2020 static {
2121 {
@@ -50,8 +50,6 @@ public final class EntityUtil {
5050
5151 ENTITY_TYPES = ENTITY_TYPE_IDS .entrySet ().stream ()
5252 .collect (Collectors .toMap (Map .Entry ::getValue , Map .Entry ::getKey ));
53-
54- ENTITY_TYPE_IDS .put (null , -1 );
5553 }
5654
5755 private EntityUtil () {
@@ -67,6 +65,8 @@ private EntityUtil() {
6765 * @return type ID of the given entity type
6866 */
6967 public static int getTypeId (final EntityType entityType ) {
68+ if (entityType == null ) return -1 ;
69+
7070 return ENTITY_TYPE_IDS .get (entityType ); // the value is always present
7171 }
7272
You can’t perform that action at this time.
0 commit comments