Skip to content

Commit

Permalink
Always drop the inventories of eliminated players
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
haykam821 committed Sep 21, 2023
1 parent f1593ae commit 23436bb
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,9 @@ private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource sourc
return ActionResult.FAIL;
}

if (!this.config.shouldKeepInventory()) {
player.vanishCursedItems();
player.getInventory().dropAll();

player.dropXp();
player.dropShoulderEntities();
}

PlayerEntry entry = this.getEntryFromPlayer(player);
boolean eliminated = false;

if (entry != null) {
if (this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES)) {
this.gameSpace.getPlayers().sendMessage(player.getDamageTracker().getDeathMessage());
Expand All @@ -323,10 +317,19 @@ private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource sourc
BeaconBreakersActivePhase.spawn(this.world, this.map, this.config.getMapConfig(), entry.getPlayer());
} else {
this.eliminate(entry);
eliminated = true;
}
}
}

if (eliminated || !this.config.shouldKeepInventory()) {
player.vanishCursedItems();
player.getInventory().dropAll();

player.dropXp();
player.dropShoulderEntities();
}

player.setHealth(player.getMaxHealth());
player.getHungerManager().setFoodLevel(20);

Expand Down

0 comments on commit 23436bb

Please sign in to comment.