Skip to content

Commit f0ec35d

Browse files
committed
v0.1.1
1 parent 85fb656 commit f0ec35d

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
v0.1.1
2+
- Fixed a bug where all players would get XP and level messages.
3+
14
v0.1.0
25
- Initial release with basic functionality that I could think of.
36

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod_logo = icon.png
2222
mod_url = https://modtale.net/mod/levelingcore-a4c07062-0b3b-409d-be88-723d62a2f672
2323
mod_issues = https://github.com/AzureDoom/LevelingCore/issues
2424
mod_sources = https://github.com/AzureDoom/LevelingCore
25-
version = 0.1.0
25+
version = 0.1.1
2626
includes_pack = false
2727
patchline = release
2828
load_user_mods = false

src/main/java/com/azuredoom/levelingcore/events/GainXPEventSystem.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import com.hypixel.hytale.server.core.modules.entity.damage.DeathSystems;
1212
import com.hypixel.hytale.server.core.modules.entitystats.EntityStatMap;
1313
import com.hypixel.hytale.server.core.modules.entitystats.asset.EntityStatType;
14-
import com.hypixel.hytale.server.core.universe.Universe;
1514
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
1615
import com.hypixel.hytale.server.core.util.Config;
1716

@@ -79,10 +78,10 @@ public void onComponentAdded(
7978
LevelingCoreApi.getLevelServiceIfPresent().ifPresent(levelService -> {
8079
int levelBefore = levelService.getLevel(player.getUuid());
8180
levelService.addXp(player.getUuid(), xpAmount);
82-
Universe.get().sendMessage(Message.raw("Gained " + xpAmount + " XP"));
81+
player.sendMessage(Message.raw("Gained " + xpAmount + " XP"));
8382
int levelAfter = levelService.getLevel(player.getUuid());
8483
if (levelAfter > levelBefore) {
85-
Universe.get().sendMessage(Message.raw("Level Up! You are now level " + levelAfter));
84+
player.sendMessage(Message.raw("Level Up! You are now level " + levelAfter));
8685
}
8786
});
8887
}

src/main/java/com/azuredoom/levelingcore/events/LossXPEventSystem.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.hypixel.hytale.server.core.entity.entities.Player;
99
import com.hypixel.hytale.server.core.modules.entity.damage.DeathComponent;
1010
import com.hypixel.hytale.server.core.modules.entity.damage.DeathSystems;
11-
import com.hypixel.hytale.server.core.universe.Universe;
1211
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
1312
import com.hypixel.hytale.server.core.util.Config;
1413

@@ -63,27 +62,26 @@ public void onComponentAdded(
6362
if (xpLoss <= 0)
6463
return;
6564
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"));
6766
int levelAfter = levelService.getLevel(playerUuid);
6867
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));
7069
}
7170
} else if (this.config.get().isEnableAllLevelsLostOnDeath()) {
7271
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"));
7473
} else if (this.config.get().getMinLevelForLevelDown() <= currentLevel) {
7574
long levelFloorXp = levelService.getXpForLevel(currentLevel);
7675
long xpLoss = (long) (currentXp * this.config.get().getXpLossPercentage());
7776
long newXp = Math.max(levelFloorXp, currentXp - xpLoss);
7877
long actualLoss = currentXp - newXp;
7978

8079
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));
8381
return;
8482
}
8583
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"));
8785
}
8886
});
8987
}

src/main/resources/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Group": "levelingcore",
33
"Name": "LevelingCore",
4-
"Version": "0.1.0",
4+
"Version": "0.1.1",
55
"Description": " A modern, flexible leveling system for Hytale!",
66
"Authors": [
77
{

0 commit comments

Comments
 (0)