|
8 | 8 | import com.hypixel.hytale.server.core.entity.entities.Player; |
9 | 9 | import com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent; |
10 | 10 | import com.hypixel.hytale.server.core.modules.entity.damage.DeathSystems; |
11 | | -import com.hypixel.hytale.server.core.universe.Universe; |
12 | 11 | import com.hypixel.hytale.server.core.universe.world.storage.EntityStore; |
13 | 12 | import com.hypixel.hytale.server.core.util.Config; |
14 | 13 |
|
@@ -63,27 +62,26 @@ public void onComponentAdded( |
63 | 62 | if (xpLoss <= 0) |
64 | 63 | return; |
65 | 64 | levelService.removeXp(playerUuid, xpLoss); |
66 | | - Universe.get().sendMessage(Message.raw("You died and lost " + xpLoss + " XP")); |
| 65 | + player.sendMessage(Message.raw("You died and lost " + xpLoss + " XP")); |
67 | 66 | int levelAfter = levelService.getLevel(playerUuid); |
68 | 67 | if (levelAfter < currentLevel) { |
69 | | - Universe.get().sendMessage(Message.raw("Level Down! You are now level " + levelAfter)); |
| 68 | + player.sendMessage(Message.raw("Level Down! You are now level " + levelAfter)); |
70 | 69 | } |
71 | 70 | } else if (this.config.get().isEnableAllLevelsLostOnDeath()) { |
72 | 71 | levelService.setLevel(playerUuid, 1); |
73 | | - Universe.get().sendMessage(Message.raw("You died and lost all levels")); |
| 72 | + player.sendMessage(Message.raw("You died and lost all levels")); |
74 | 73 | } else if (this.config.get().getMinLevelForLevelDown() <= currentLevel) { |
75 | 74 | long levelFloorXp = levelService.getXpForLevel(currentLevel); |
76 | 75 | long xpLoss = (long) (currentXp * this.config.get().getXpLossPercentage()); |
77 | 76 | long newXp = Math.max(levelFloorXp, currentXp - xpLoss); |
78 | 77 | long actualLoss = currentXp - newXp; |
79 | 78 |
|
80 | 79 | if (actualLoss <= 0) { |
81 | | - Universe.get() |
82 | | - .sendMessage(Message.raw("You are already at the minimum XP for level " + currentLevel)); |
| 80 | + player.sendMessage(Message.raw("You are already at the minimum XP for level " + currentLevel)); |
83 | 81 | return; |
84 | 82 | } |
85 | 83 | levelService.setXp(playerUuid, newXp); |
86 | | - Universe.get().sendMessage(Message.raw("You died and lost " + actualLoss + " XP")); |
| 84 | + player.sendMessage(Message.raw("You died and lost " + actualLoss + " XP")); |
87 | 85 | } |
88 | 86 | }); |
89 | 87 | } |
|
0 commit comments