Skip to content

Commit

Permalink
Fixed a much less spooky death bug
Browse files Browse the repository at this point in the history
  • Loading branch information
preprocessor committed Apr 23, 2024
1 parent 1233258 commit 2f31654
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/lusiiplugin/mixin/EntityPlayerMPMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lusiiplugin.utils.PlayerData;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.entity.Entity;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.world.World;
import net.minecraft.server.entity.player.EntityPlayerMP;
Expand All @@ -26,6 +27,11 @@ private void tickPlayerData(CallbackInfo ci) {
data.tick();
}
}

@Inject(method = "onDeath", at = @At("HEAD"))
public void saveOnDeath(Entity entity, CallbackInfo ci) {
PlayerData.get(this).save();
}
}

@Mixin(value = EntityPlayerMP.class, remap = false)
Expand Down

0 comments on commit 2f31654

Please sign in to comment.