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:
parent
9ab41f73ee
commit
92e9e9d15b
@ -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;
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user