Clean up code, replace switch and try-with-resource where possible.

This commit is contained in:
Đạt Nhân Trương
2022-08-07 21:51:10 +07:00
parent f983b4dccf
commit 0ef3e69638
22 changed files with 609 additions and 589 deletions

View File

@@ -86,13 +86,17 @@ public final class CreateCharHandler extends AbstractPacketHandler {
}
int status;
if (job == 0) { // Knights of Cygnus
switch (job) {
case 0: // Knights of Cygnus
status = NoblesseCreator.createCharacter(c, name, face, hair + haircolor, skincolor, top, bottom, shoes, weapon, gender);
} else if (job == 1) { // Adventurer
break;
case 1: // Adventurer
status = BeginnerCreator.createCharacter(c, name, face, hair + haircolor, skincolor, top, bottom, shoes, weapon, gender);
} else if (job == 2) { // Aran
break;
case 2: // Aran
status = LegendCreator.createCharacter(c, name, face, hair + haircolor, skincolor, top, bottom, shoes, weapon, gender);
} else {
break;
default:
c.sendPacket(PacketCreator.deleteCharResponse(0, 9));
return;
}