43 private static final ImmutableSet<Integer> VALID_MALE_HEAD_MODELS = ImmutableSet.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 129, 130, 131, 132, 133, 134, 142, 144, 145, 146, 147, 148, 149, 150);
44 private static final ImmutableSet<Integer> VALID_MALE_JAW_MODELS = ImmutableSet.of(10, 11, 12, 13, 14, 15, 16, 17, 111, 112, 113, 114, 115, 116, 117);
45 private static final ImmutableSet<Integer> VALID_MALE_TORSO_MODELS = ImmutableSet.of(18, 19, 20, 21, 22, 23, 24, 25, 105, 106, 107, 108, 109, 110);
46 private static final ImmutableSet<Integer> VALID_MALE_ARM_MODELS = ImmutableSet.of(26, 27, 28, 29, 30, 31, 32, 84, 85, 86, 87, 88);
47 private static final ImmutableSet<Integer> VALID_MALE_LEG_MODLES = ImmutableSet.of(36, 37, 38, 39, 40, 41, 100, 101, 102, 103, 104);
48 private static final ImmutableSet<Integer> VALID_FEMALE_HEAD_MODELS = ImmutableSet.of(45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 141, 143);
49 private static final ImmutableSet<Integer> VALID_FEMALE_TORSO_MODELS = ImmutableSet.of(56, 57, 58, 59, 60, 89, 90, 91, 92, 93, 94);
50 private static final ImmutableSet<Integer> VALID_FEMALE_ARM_MODELS = ImmutableSet.of(61, 62, 63, 64, 65, 66, 95, 96, 97, 98, 99);
51 private static final ImmutableSet<Integer> VALID_FEMALE_LEG_MODELS = ImmutableSet.of(70, 71, 72, 73, 74, 75, 76, 77, 78, 135, 136, 137, 138, 139, 140);
55 final int gender = packet.readByte(
false);
56 final int head = packet.readByte(
false);
57 final int jaw = packet.readByte(
false);
58 final int torso = packet.readByte(
false);
59 final int arms = packet.readByte(
false);
60 final int hands = packet.readByte(
false);
61 final int legs = packet.readByte(
false);
62 final int feet = packet.readByte(
false);
63 final int hairColor = packet.readByte(
false);
64 final int torsoColor = packet.readByte(
false);
65 final int legsColor = packet.readByte(
false);
66 final int feetColor = packet.readByte(
false);
67 final int skinColor = packet.readByte(
false);
69 player.getEvents().widget(player,
new AppearanceChangeEvent(
70 gender, head, jaw, torso, arms, hands, legs, feet,
71 hairColor, torsoColor, legsColor, feetColor, skinColor
80 if (!VALID_MALE_HEAD_MODELS.contains(appearance.
getHead())) {
81 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid head id %d", appearance.
getHead()) :
"You cannot change your appearance, because you have an invalid head id."));
85 if (!VALID_MALE_JAW_MODELS.contains(appearance.
getBeard())) {
86 player.send(
new SendMessage(PlayerRight.isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid jaw id %d", appearance.
getBeard()) :
"You cannot change your appearance, because you have an invalid jaw id."));
90 if (!VALID_MALE_TORSO_MODELS.contains(appearance.
getTorso())) {
91 player.send(
new SendMessage(PlayerRight.isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid torso id %d", appearance.
getTorso()) :
"You cannot change your appearance, because you have an invalid torso id."));
95 if (!VALID_MALE_ARM_MODELS.contains(appearance.
getArms())) {
96 player.send(
new SendMessage(PlayerRight.isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid arm id %d", appearance.
getHead()) :
"You cannot change your appearance, because you have an invalid arm id."));
101 player.send(
new SendMessage(PlayerRight.isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid hand id %d", appearance.
getHands()) :
"You cannot change your appearance, because you have an invalid hand id."));
105 if (!VALID_MALE_LEG_MODLES.contains(appearance.
getLegs())) {
106 player.send(
new SendMessage(PlayerRight.isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid leg id %d", appearance.
getLegs()) :
"You cannot change your appearance, because you have an invalid leg id."));
110 if (!(appearance.
getFeet() >= 42 && appearance.
getFeet() <= 43)) {
111 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid feet id %d", appearance.
getFeet()) :
"You cannot change your appearance, because you have an invalid feet id."));
117 if (!VALID_FEMALE_HEAD_MODELS.contains(appearance.
getHead())) {
118 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid head id %d", appearance.
getHead()) :
"You cannot change your appearance, because you have an invalid head id."));
123 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid jaw id %d", appearance.
getBeard()) :
"You cannot change your appearance, because you have an invalid jaw id."));
127 if (!VALID_FEMALE_TORSO_MODELS.contains(appearance.
getTorso())) {
128 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid torso id %d", appearance.
getTorso()) :
"You cannot change your appearance, because you have an invalid torso id."));
132 if (!VALID_FEMALE_ARM_MODELS.contains(appearance.
getArms())) {
133 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid arm id %d", appearance.
getHead()) :
"You cannot change your appearance, because you have an invalid arm id."));
138 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid hand id %d", appearance.
getHands()) :
"You cannot change your appearance, because you have an invalid hand id."));
142 if (!VALID_FEMALE_LEG_MODELS.contains(appearance.
getLegs())) {
143 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid leg id %d", appearance.
getLegs()) :
"You cannot change your appearance, because you have an invalid leg id."));
147 if (!(appearance.
getFeet() >= 79 && appearance.
getFeet() <= 80)) {
148 player.send(
new SendMessage(
PlayerRight.
isDeveloper(player) ? String.format(
"Cannot change appearance - Invalid feet id %d", appearance.
getFeet()) :
"You cannot change your appearance, because you have an invalid feet id."));
179 int[] DONATOR_SKINS = { 8, 9 };
181 for (
int skin : DONATOR_SKINS) {
183 player.message(
"You need to be a donator to use this skin!");