42public class MobAnimation {
44 public static final int PLAYER_STAND = 808;
45 public static final int PLAYER_WALK = 819;
46 public static final int PLAYER_TURN_180 = 820;
47 public static final int PLAYER_TURN_90_CW = 821;
48 public static final int PLAYER_TURN_90_CCW = 822;
49 public static final int PLAYER_TURN = 823;
50 public static final int PLAYER_RUN = 824;
57 private int turn90CCW;
59 private final EnumSet<UpdateFlag> updateFlags;
61 MobAnimation(EnumSet<UpdateFlag> updateFlags) {
62 this.updateFlags = updateFlags;
65 public void set(
int stand,
int turn,
int walk,
int turn180,
int turn90cw,
int turn90ccw,
int run) {
69 this.turn180 = turn180;
70 this.turn90CW = turn90cw;
71 this.turn90CCW = turn90ccw;
77 this.stand = PLAYER_STAND;
78 this.turn = PLAYER_TURN;
79 this.walk = PLAYER_WALK;
80 this.turn180 = PLAYER_TURN_180;
81 this.turn90CW = PLAYER_TURN_90_CW;
82 this.turn90CCW = PLAYER_TURN_90_CCW;
83 this.run = PLAYER_RUN;
89 this.walk = definition.
getWalk();
96 public int getStand() {
100 public int getTurn() {
104 public int getWalk() {
108 public int getTurn180() {
109 return turn180 <= 0 || turn180 == PLAYER_TURN_180 ? getWalk() : turn180;
112 public int getTurn90CW() {
113 return turn90CW <= 0 || turn90CW == PLAYER_TURN_90_CW ? getWalk() : turn90CW;
116 public int getTurn90CCW() {
117 return turn90CCW <= 0 || turn90CCW == PLAYER_TURN_90_CCW ? getWalk() : turn90CCW;
120 public int getRun() {
124 public void setStand(
int stand) {
125 if (this.stand != stand)
130 public void setTurn(
int turn) {
131 if (this.turn != turn)
136 public void setWalk(
int walk) {
137 if (this.walk != walk)
142 public void setTurn180(
int turn180) {
143 if (this.turn180 != turn180)
145 this.turn180 = turn180;
148 public void setTurn90CW(
int turn90cw) {
149 if (turn90CW != turn90cw)
154 public void setTurn90CCW(
int turn90ccw) {
155 if (turn90CCW != turn90ccw)
157 turn90CCW = turn90ccw;
160 public void setRun(
int run) {
166 public MobAnimation copy() {
167 MobAnimation other =
new MobAnimation(updateFlags);
171 other.turn180 = turn180;
172 other.turn90CW = turn90CW;
173 other.turn90CCW = turn90CCW;