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 14
14
public final class EntityUtil {
15
15
16
16
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 ;
19
19
20
20
static {
21
21
{
@@ -50,8 +50,6 @@ public final class EntityUtil {
50
50
51
51
ENTITY_TYPES = ENTITY_TYPE_IDS .entrySet ().stream ()
52
52
.collect (Collectors .toMap (Map .Entry ::getValue , Map .Entry ::getKey ));
53
-
54
- ENTITY_TYPE_IDS .put (null , -1 );
55
53
}
56
54
57
55
private EntityUtil () {
@@ -67,6 +65,8 @@ private EntityUtil() {
67
65
* @return type ID of the given entity type
68
66
*/
69
67
public static int getTypeId (final EntityType entityType ) {
68
+ if (entityType == null ) return -1 ;
69
+
70
70
return ENTITY_TYPE_IDS .get (entityType ); // the value is always present
71
71
}
72
72
You can’t perform that action at this time.
0 commit comments