if player healing - damage -1 then allow
Some checks failed
/ Auto-Build-App (push) Failing after 40s

This commit is contained in:
pietru 2025-08-24 23:40:31 +02:00
parent 88d1bcfea1
commit 87cf78834b
2 changed files with 4 additions and 0 deletions

View file

@ -32,6 +32,8 @@ public class EntityMixin {
@Inject(method = "hit", at = @At("HEAD"), cancellable = true)
private void event_player_hit(CallbackInfo ci, @Local(argsOnly = true) IDamageSource damageSource, @Local(argsOnly = true) float amount){
if (amount<0)
return;
if (damageSource instanceof Entity) {
if (damageSource instanceof PlayerEntity) {
Account account = ((PlayerEntity) damageSource).getPlayer().getAccount();

View file

@ -23,6 +23,8 @@ public class PlayerEntityMixin extends EntityMixin{
@Inject(method = "hit", at = @At("HEAD"), cancellable = true)
private void event_player_hit(CallbackInfo ci, @Local(argsOnly = true) IDamageSource damageSource, @Local(argsOnly = true) float amount){
if (amount<0)
return;
if (damageSource instanceof Entity) {
if (damageSource instanceof PlayerEntity) {
Account account = ((PlayerEntity) damageSource).getPlayer().getAccount();