EntityPose.CROUCHING -> EntityPose.SNEAKING, fixes error in 1.14 and maintainability
This commit is contained in:
parent
5d52f91f25
commit
822ad1b7fd
@ -9,6 +9,6 @@ public enum EntityPose {
|
|||||||
SLEEPING,
|
SLEEPING,
|
||||||
SWIMMING,
|
SWIMMING,
|
||||||
SPIN_ATTACK,
|
SPIN_ATTACK,
|
||||||
CROUCHING,
|
SNEAKING,
|
||||||
DYING
|
DYING
|
||||||
}
|
}
|
||||||
|
@ -663,7 +663,7 @@ public class FlagWatcher {
|
|||||||
} else if (isSwimming()) {
|
} else if (isSwimming()) {
|
||||||
setEntityPose(EntityPose.SWIMMING);
|
setEntityPose(EntityPose.SWIMMING);
|
||||||
} else if (isSneaking()) {
|
} else if (isSneaking()) {
|
||||||
setEntityPose(EntityPose.CROUCHING);
|
setEntityPose(EntityPose.SNEAKING);
|
||||||
} else {
|
} else {
|
||||||
setEntityPose(EntityPose.STANDING);
|
setEntityPose(EntityPose.STANDING);
|
||||||
}
|
}
|
||||||
|
@ -1389,11 +1389,13 @@ public class ReflectionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Object getNmsEntityPose(EntityPose entityPose) {
|
public static Object getNmsEntityPose(EntityPose entityPose) {
|
||||||
return Enum.valueOf(getNmsClass("EntityPose"), entityPose.name());
|
return Enum.valueOf(getNmsClass("EntityPose"),
|
||||||
|
entityPose == EntityPose.SNEAKING && NmsVersion.v1_15.isSupported() ? "CROUCHING" : entityPose.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EntityPose getEntityPose(Object nmsEntityPose) {
|
public static EntityPose getEntityPose(Object nmsEntityPose) {
|
||||||
return EntityPose.valueOf(((Enum) nmsEntityPose).name());
|
String name = ((Enum) nmsEntityPose).name();
|
||||||
|
return EntityPose.valueOf(name.equals("CROUCHING") ? "SNEAKING" : name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static WrappedWatchableObject createWatchable(MetaIndex index, Object obj) {
|
public static WrappedWatchableObject createWatchable(MetaIndex index, Object obj) {
|
||||||
|
Loading…
Reference in New Issue
Block a user