Refactor of animations

This commit is contained in:
2024-03-11 15:44:31 -04:00
parent 4f7c34aec9
commit ef38e93c11
3 changed files with 18 additions and 71 deletions
+18 -18
View File
@@ -982,66 +982,66 @@ public enum CombatManager {
if (wb == null)
return 75;
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID());
if (mainHand) {
if (wb.getAnimations().size() > 0) {
if (template.weapon_attack_anim_right.size() > 0) {
int animation;
int random = ThreadLocalRandom.current().nextInt(wb.getAnimations().size());
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_right.size());
try {
animation = wb.getAnimations().get(random);
animation = template.weapon_attack_anim_right.get(random)[0];
return animation;
} catch (Exception e) {
Logger.error(e.getMessage());
return wb.getAnimations().get(0);
return template.weapon_attack_anim_right.get(0)[0];
}
} else if (wb.getOffHandAnimations().size() > 0) {
} else if (template.weapon_attack_anim_left.size() > 0) {
int animation;
int random = ThreadLocalRandom.current().nextInt(wb.getOffHandAnimations().size());
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size());
try {
animation = wb.getOffHandAnimations().get(random);
animation = template.weapon_attack_anim_left.get(random)[0];
return animation;
} catch (Exception e) {
Logger.error(e.getMessage());
return wb.getOffHandAnimations().get(0);
return template.weapon_attack_anim_right.get(0)[0];
}
}
} else {
if (wb.getOffHandAnimations().size() > 0) {
if (template.weapon_attack_anim_left.size() > 0) {
int animation;
int random = ThreadLocalRandom.current().nextInt(wb.getOffHandAnimations().size());
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size());
try {
animation = wb.getOffHandAnimations().get(random);
animation = template.weapon_attack_anim_left.get(random)[0];
return animation;
} catch (Exception e) {
Logger.error(e.getMessage());
return wb.getOffHandAnimations().get(0);
return template.weapon_attack_anim_right.get(0)[0];
}
} else if (wb.getAnimations().size() > 0) {
} else if (template.weapon_attack_anim_left.size() > 0) {
int animation;
int random = ThreadLocalRandom.current().nextInt(wb.getAnimations().size());
int random = ThreadLocalRandom.current().nextInt(template.weapon_attack_anim_left.size());
try {
animation = wb.getAnimations().get(random);
animation = template.weapon_attack_anim_left.get(random)[0];
return animation;
} catch (Exception e) {
Logger.error(e.getMessage());
return wb.getAnimations().get(0);
return template.weapon_attack_anim_right.get(0)[0];
}
}
}
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID());
String required = template.item_skill_used;
String mastery = wb.getMastery();