Explicit types for 1.14 and 1.15

This commit is contained in:
fullwall 2021-09-20 21:16:40 +08:00
parent 981c1a73be
commit f9bb877e85
2 changed files with 4 additions and 2 deletions

View File

@ -1188,8 +1188,9 @@ public class NMSImpl implements NMSBridge {
if (entity instanceof Player) {
((Player) entity).setSneaking(sneaking);
}
EntityPose pose = sneaking ? EntityPose.SNEAKING : EntityPose.STANDING;
try {
ENTITY_SETPOSE.invoke(getHandle(entity), sneaking ? EntityPose.SNEAKING : EntityPose.STANDING);
ENTITY_SETPOSE.invoke(getHandle(entity), pose);
} catch (Throwable e) {
e.printStackTrace();
}

View File

@ -1206,8 +1206,9 @@ public class NMSImpl implements NMSBridge {
if (entity instanceof Player) {
((Player) entity).setSneaking(sneaking);
}
EntityPose pose = sneaking ? EntityPose.CROUCHING : EntityPose.STANDING;
try {
ENTITY_SETPOSE.invoke(getHandle(entity), sneaking ? EntityPose.CROUCHING : EntityPose.STANDING);
ENTITY_SETPOSE.invoke(getHandle(entity), pose);
} catch (Throwable e) {
e.printStackTrace();
}