Make durability work like sunlit valley
This commit is contained in:
@@ -1252,7 +1252,8 @@ export class GameServer {
|
||||
}
|
||||
}
|
||||
|
||||
// like minecraft: everything they carried falls out where they died, and they start over at spawn
|
||||
// like minecraft: everything they carried falls out where they died, and they start over at spawn. tools lose 1
|
||||
// durability first, and ones that run out break instead of dropping
|
||||
#kill(player: ServerPlayer, cause: string) {
|
||||
const { x, y, z } = player;
|
||||
this.close_screen(player);
|
||||
@@ -1260,6 +1261,7 @@ export class GameServer {
|
||||
const item = player.inventory.get_item(i);
|
||||
if (item) {
|
||||
player.inventory.set_item(i, undefined);
|
||||
if (item.damage(1)) continue;
|
||||
this.pop_item(Math.floor(x), Math.floor(Math.max(y, 0)), Math.floor(z), item);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user