修改等级显示

This commit is contained in:
17146 2024-08-15 23:18:06 +08:00
parent 4e7119befb
commit 6fc74e3592
2 changed files with 5 additions and 12 deletions

View file

@ -226,13 +226,6 @@ public class PlayerEventHandler {
if (player.getPersistentData().getDouble("prone") > 0) { if (player.getPersistentData().getDouble("prone") > 0) {
player.getPersistentData().putDouble("prone", (player.getPersistentData().getDouble("prone") - 1)); player.getPersistentData().putDouble("prone", (player.getPersistentData().getDouble("prone") - 1));
} }
// boolean flag = !(player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).refresh;
//
// player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
// capability.refresh = flag;
// capability.syncPlayerVariables(player);
// });
} }
/** /**
@ -271,7 +264,7 @@ public class PlayerEventHandler {
if (tag.getDouble("damagetotal") >= tag.getDouble("exp2")) { if (tag.getDouble("damagetotal") >= tag.getDouble("exp2")) {
tag.putDouble("exp1", (tag.getDouble("exp2"))); tag.putDouble("exp1", (tag.getDouble("exp2")));
tag.putInt("level", tag.getInt("level") + 1); tag.putInt("level", tag.getInt("level") + 1);
tag.putDouble("UpgradePoint", tag.getDouble("UpgradePoint") + 0.33334); tag.putDouble("UpgradePoint", tag.getDouble("UpgradePoint") + 0.25);
} }
tag.putDouble("damagenow", (tag.getDouble("damagetotal") - tag.getDouble("exp1"))); tag.putDouble("damagenow", (tag.getDouble("damagetotal") - tag.getDouble("exp1")));
tag.putDouble("damageneed", (tag.getDouble("exp2") - tag.getDouble("exp1"))); tag.putDouble("damageneed", (tag.getDouble("exp2") - tag.getDouble("exp1")));

View file

@ -62,13 +62,13 @@ public class TooltipTool {
double rate = ItemNBTTool.getDouble(stack, "damagenow", 0) / ItemNBTTool.getDouble(stack, "damageneed", 1); double rate = ItemNBTTool.getDouble(stack, "damagenow", 0) / ItemNBTTool.getDouble(stack, "damageneed", 1);
ChatFormatting formatting; ChatFormatting formatting;
if (level < 4) { if (level < 10) {
formatting = ChatFormatting.WHITE; formatting = ChatFormatting.WHITE;
} else if (level < 6) { } else if (level < 20) {
formatting = ChatFormatting.AQUA; formatting = ChatFormatting.AQUA;
} else if (level < 8) { } else if (level < 30) {
formatting = ChatFormatting.LIGHT_PURPLE; formatting = ChatFormatting.LIGHT_PURPLE;
} else if (level < 10) { } else if (level < 40) {
formatting = ChatFormatting.GOLD; formatting = ChatFormatting.GOLD;
} else { } else {
formatting = ChatFormatting.RED; formatting = ChatFormatting.RED;