fix:修复玩家死亡后原地复活的问题
Some checks failed
build / build (push) Has been cancelled

- 在玩家死亡时移除其 UUID 以避免原地复活
- 确保墓碑正确创建,防止玩家直接死亡
This commit is contained in:
fly6516 2025-04-15 20:53:17 +08:00
parent 8d9a01d407
commit a2ab7492b9

View File

@ -38,6 +38,7 @@ public class SimpleTombstone implements ModInitializer {
ServerLivingEntityEvents.ALLOW_DEATH.register((entity, damageSource, damageAmount) -> {
if (entity instanceof ServerPlayerEntity player) {
LOGGER.info("[SimpleTombstone] 检测到玩家 {} 死亡,创建墓碑...", player.getName().getString());
RESURRECTED_PLAYERS.remove(player.getUuid());
createTombstoneForMixin(player);
DEAD_PLAYERS.add(player.getUuid());
return false; // 阻止默认死亡逻辑防止玩家直接死亡