Skip to content

Commit

Permalink
If dying for the first time in a world with an empty inventory, playe…
Browse files Browse the repository at this point in the history
…rs will no longer be disconnected
  • Loading branch information
B1n-ry committed Sep 29, 2024
1 parent 755a63c commit c67b527
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# You're in Grave Danger 2.0.6

### Fixes
* If dying for the first time in a world with an empty inventory, players will
no longer be disconnected.

---

# You're in Grave Danger 2.0.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ public void apply(ServerPlayer player) {
}
if (extraFeaturesConfig.graveCompass.receiveOnRespawn) {
List<GraveComponent> playerGraves = DeathInfoManager.INSTANCE.getBackupData(new ResolvableProfile(player.getGameProfile()));
GraveComponent latestGrave = playerGraves.getLast();
if (!playerGraves.isEmpty()) {
GraveComponent latestGrave = playerGraves.getLast();

GraveCompassHelper.giveCompass(player, latestGrave.getGraveId(), latestGrave.getPos(), latestGrave.getWorldRegistryKey());
GraveCompassHelper.giveCompass(player, latestGrave.getGraveId(), latestGrave.getPos(), latestGrave.getWorldRegistryKey());
}
}

for (YigdConfig.RespawnConfig.ExtraItemDrop extraItemDrop : config.respawnConfig.extraItemDrops) {
Expand Down

0 comments on commit c67b527

Please sign in to comment.