Skip to content

Commit

Permalink
Fix invulnerability
Browse files Browse the repository at this point in the history
I hate the copyFrom function now
  • Loading branch information
QPCrummer committed Jan 13, 2025
1 parent 0c6e92d commit 3631d06
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ public ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile
nbt.putInt("invulnerability_ticks", invulnerableTicks);
}

@Inject(method = "copyFrom", at = @At("TAIL"))
private void lifesteal$copyInvulnerability(ServerPlayerEntity oldPlayer, boolean alive, CallbackInfo ci) {
this.invulnerableTicks = ((PlayerInvulnerabilityInterface)oldPlayer).getRemaining();
}

@Override
public void setReviveInvulnerability() {
invulnerableTicks = this.server.getGameRules().getInt(LifeStealGamerules.RESPAWN_INVULNERABILITY) * 20;
Expand Down

0 comments on commit 3631d06

Please sign in to comment.