1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 12:05:16 +01:00

Adding and taking exp should calculating correctly

This commit is contained in:
montlikadani 2019-11-17 12:56:13 +01:00
parent 9ab41f73ee
commit 92e9e9d15b
2 changed files with 4 additions and 7 deletions

View File

@ -64,19 +64,16 @@ public class exp implements Cmd {
// check if player already has the job
if (jPlayer.isInJob(job)) {
JobProgression prog = jPlayer.getJobProgression(job);
double total = 0d;
switch (action) {
case Add:
total = (prog.getExperience() + amount);
prog.addExperience(total);
prog.addExperience(amount);
break;
case Set:
prog.setExperience(amount);
break;
case Take:
total = (prog.getExperience() - amount);
prog.takeExperience(total);
prog.takeExperience(amount);
break;
default:
break;

View File

@ -291,9 +291,9 @@ public class ConfigManager {
} else if (actionType == ActionType.KILL || actionType == ActionType.TAME || actionType == ActionType.BREED || actionType == ActionType.MILK) {
// check entities
EntityType entity = EntityType.fromName(myKey.toUpperCase());
EntityType entity = EntityType.fromName(myKey);
if (entity == null) {
entity = EntityType.valueOf(myKey.toUpperCase());
entity = EntityType.valueOf(myKey);
}
if (entity != null && entity.isAlive()) {