Skip to content

Commit

Permalink
Fix air bubbles above extra HP
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewperiut committed Nov 3, 2023
1 parent 29102e4 commit 9734433
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.parallel=true
loader_version=0.14.19-babric.1

# Mod Properties
mod_version = 0.5.3
mod_version = 0.5.4
maven_group = com.matthewperiut
archives_base_name = accessoryapi
stapi_version=dcfa3d8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Random;
Expand Down Expand Up @@ -77,4 +78,21 @@ public void renderExtraHud(float bl, boolean i, int j, int par4, CallbackInfo ci
InGame instance = (InGame) (Object) this;
renderHearts(instance);
}

public void moveBubblesUpDependingOnExtraHP(InGame instance, int a, int b, int c, int d, int e, int f)
{
int multiplier = (((PlayerExtraHP) minecraft.player).getExtraHP() + 18) / 20;
int movement = 10 * multiplier + (multiplier > 0 ? 1 : 0);
instance.blit(a,b-movement,c,d,e,f);
}
@Redirect(method = "renderHud", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/InGame;blit(IIIIII)V", ordinal = 11))
public void moveBubblesUpDependingOnExtraHP1(InGame instance, int a, int b, int c, int d, int e, int f)
{
moveBubblesUpDependingOnExtraHP(instance, a, b, c, d, e, f);
}
@Redirect(method = "renderHud", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/InGame;blit(IIIIII)V", ordinal = 12))
public void moveBubblesUpDependingOnExtraHP2(InGame instance, int a, int b, int c, int d, int e, int f)
{
moveBubblesUpDependingOnExtraHP(instance, a, b, c, d, e, f);
}
}

0 comments on commit 9734433

Please sign in to comment.