Skip to content

Commit a458ee2

Browse files
committed
fix: use EntityUtil in WrapperPlayServerSpawnEntity
1 parent eb2b1cc commit a458ee2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSpawnEntity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package com.comphenix.packetwrapper;
2020

2121
import com.comphenix.packetwrapper.util.BackwardsCompatible;
22+
import com.comphenix.packetwrapper.util.EntityUtil;
2223
import com.comphenix.protocol.PacketType;
2324
import com.comphenix.protocol.events.PacketContainer;
2425
import com.comphenix.protocol.events.PacketEvent;
@@ -329,25 +330,24 @@ public void setOptionalSpeedZ(double value) {
329330
public EntityType getType() {
330331
return MINOR_VERSION >= 14
331332
? handle.getEntityTypeModifier().read(0)
332-
: EntityType.fromId(handle.getIntegers().read(MINOR_VERSION >= 9 ? 6 : 9));
333+
: EntityUtil.getEntityTypeById(handle.getIntegers().read(MINOR_VERSION >= 9 ? 6 : 9));
333334
}
334335

335336
/**
336337
* Set the type of object.
337338
*
338339
* @param value - new value.
339340
*/
340-
@SuppressWarnings("deprecation")
341341
public void setType(EntityType value) {
342342
if (MINOR_VERSION >= 14) handle.getEntityTypeModifier().write(0, value);
343-
else handle.getIntegers().write(MINOR_VERSION >= 9 ? 6 : 9, (int) value.getTypeId());
343+
else handle.getIntegers().write(MINOR_VERSION >= 9 ? 6 : 9, EntityUtil.getTypeId(value));
344344
}
345345

346346
/**
347347
* Retrieve object data.
348348
* <p>
349349
* The content depends on the object type:
350-
* <table border="1" cellpadding="4">
350+
* <table border="1" cellpadding="4" summary="Value meaning">
351351
* <tr>
352352
* <th>Object Type:</th>
353353
* <th>Name:</th>

0 commit comments

Comments
 (0)