Fixed loading issue with BetterMountHud

This commit is contained in:
FlorianMichael 2023-03-06 19:57:24 +01:00
parent dc23ac56eb
commit 80b93de586
2 changed files with 7 additions and 5 deletions

View File

@ -8,7 +8,7 @@ yarn_mappings=1.19.3+build.5
loader_version=0.14.14
# viafabricplus
mod_version=1.7.2
mod_version=1.7.3
maven_group=de.florianmichael
archives_base_name=viafabricplus

View File

@ -10,6 +10,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(InGameHud.class)
public abstract class MixinInGameHud {
@ -39,10 +40,11 @@ public abstract class MixinInGameHud {
if (VisualSettings.getClassWrapper().removeNewerHudElements.getValue()) ci.cancel();
}
@Redirect(method = "renderStatusBars", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;getHeartCount(Lnet/minecraft/entity/LivingEntity;)I"))
private int removeHungerBar(InGameHud instance, LivingEntity entity) {
if (VisualSettings.getClassWrapper().removeNewerHudElements.getValue()) return 1;
return getHeartCount(entity);
@Inject(method = "getHeartCount", at = @At("HEAD"), cancellable = true)
public void removeHungerBar(LivingEntity entity, CallbackInfoReturnable<Integer> cir) {
if (VisualSettings.getClassWrapper().removeNewerHudElements.getValue()) {
cir.setReturnValue(1);
}
}
// Moving down all remaining elements