Fix experience rewards with VotingPlugin
This commit is contained in:
1 parent
970caf7eaf
commit
9b5bceceed
2 files changed
+3
-8
No files matched your search
@@ -27,7 +27,6 @@ public class GameModeInventoriesInventory {
|
||||
private final boolean saveArmour;
|
||||
private final boolean saveEnderChest;
|
||||
private final boolean potions;
|
||||
GameModeInventoriesXPCalculator xpc;
|
||||
|
||||
public GameModeInventoriesInventory(GameModeInventories plugin) {
|
||||
|
||||
@@ -44,6 +43,7 @@ public class GameModeInventoriesInventory {
|
||||
String uuid = player.getUniqueId().toString();
|
||||
String name = player.getName();
|
||||
String currentGM = player.getGameMode().name();
|
||||
GameModeInventoriesXPCalculator xpc = null;
|
||||
if (saveXP) {
|
||||
|
||||
xpc = new GameModeInventoriesXPCalculator(player);
|
||||
|
||||
+2
-7
@@ -199,13 +199,8 @@ public class GameModeInventoriesXPCalculator {
|
||||
|
||||
}
|
||||
|
||||
// Increment total experience - this should force the server to send an update
|
||||
// packet
|
||||
if (xp > base) {
|
||||
|
||||
p.setTotalExperience(p.getTotalExperience() + xp - (int) base);
|
||||
|
||||
}
|
||||
// Keep the vanilla counter equal to the absolute total being applied
|
||||
p.setTotalExperience(xp);
|
||||
|
||||
double pct = (base - getXpForLevel(newLvl) + amt) / (double) (getXpNeededToLevelUp(newLvl));
|
||||
p.setExp((float) pct);
|
||||
|
||||
Reference in new issue
Block a user