mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-26 11:07:59 +01:00
Set exp level for /npc command expcost rather than exp %
This commit is contained in:
parent
dad74a3279
commit
23c4779404
@ -102,11 +102,11 @@ public class CommandTrait extends Trait {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (experienceCost > 0) {
|
if (experienceCost > 0) {
|
||||||
if (player.getExp() < experienceCost) {
|
if (player.getLevel() < experienceCost) {
|
||||||
sendErrorMessage(player, CommandTraitMessages.MISSING_EXPERIENCE, null, experienceCost);
|
sendErrorMessage(player, CommandTraitMessages.MISSING_EXPERIENCE, null, experienceCost);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
player.setExp(player.getExp() - experienceCost);
|
player.setLevel((int) (player.getLevel() - experienceCost));
|
||||||
}
|
}
|
||||||
if (itemRequirements.size() > 0) {
|
if (itemRequirements.size() > 0) {
|
||||||
List<ItemStack> req = Lists.newArrayList(itemRequirements);
|
List<ItemStack> req = Lists.newArrayList(itemRequirements);
|
||||||
|
Loading…
Reference in New Issue
Block a user