diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-06 19:09:11 -0230 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-06 19:09:11 -0230 |
commit | 93248d28d6b314b42f6b0d82164975343b214ece (patch) | |
tree | e3e06c24454080f059355133d633e5a076d85ad3 /src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java | |
parent | 91464c8f433e8bf323932ac956678971207b607e (diff) | |
parent | 804767ebfc26e2a1252bc327def02389b35dfc6e (diff) | |
download | skyblockhud-93248d28d6b314b42f6b0d82164975343b214ece.tar.gz skyblockhud-93248d28d6b314b42f6b0d82164975343b214ece.tar.bz2 skyblockhud-93248d28d6b314b42f6b0d82164975343b214ece.zip |
Merge pull request #2 from ThatGravyBoat/prettier
Add prettier settings and format code
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java index ce7c228..9886ba0 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/mixins/MixinGuiIngameForge.java @@ -1,5 +1,7 @@ package com.thatgravyboat.skyblockhud.mixins; +import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; + import com.thatgravyboat.skyblockhud.SkyblockHud; import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.RenderGameOverlayEvent; @@ -10,8 +12,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import static net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType.*; - @Mixin(GuiIngameForge.class) public class MixinGuiIngameForge { @@ -19,8 +19,8 @@ public class MixinGuiIngameForge { private RenderGameOverlayEvent eventParent; @Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderArmor(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideArmor && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderArmor(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideArmor && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(ARMOR)) return; post(ARMOR); @@ -28,8 +28,8 @@ public class MixinGuiIngameForge { } @Inject(method = "renderHealth", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderHealth(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideHearts && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderHealth(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideHearts && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(HEALTH)) return; post(HEALTH); @@ -37,8 +37,8 @@ public class MixinGuiIngameForge { } @Inject(method = "renderAir", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderAir(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideAir && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderAir(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideAir && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(AIR)) return; post(AIR); @@ -46,8 +46,8 @@ public class MixinGuiIngameForge { } @Inject(method = "renderHealthMount", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderHealthMount(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideAnimalHearts && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderHealthMount(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideAnimalHearts && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(HEALTHMOUNT)) return; post(HEALTHMOUNT); @@ -55,8 +55,8 @@ public class MixinGuiIngameForge { } @Inject(method = "renderExperience", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderExperience(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderExperience(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(EXPERIENCE)) return; post(EXPERIENCE); @@ -64,8 +64,8 @@ public class MixinGuiIngameForge { } @Inject(method = "renderJumpBar", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderJumpBar(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderJumpBar(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideXpBar && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(JUMPBAR)) return; post(JUMPBAR); @@ -73,20 +73,19 @@ public class MixinGuiIngameForge { } @Inject(method = "renderFood", at = @At("HEAD"), cancellable = true, remap = false) - public void onRenderFood(int width, int height, CallbackInfo ci){ - if (SkyblockHud.config.renderer.hideFood && SkyblockHud.hasSkyblockScoreboard()){ + public void onRenderFood(int width, int height, CallbackInfo ci) { + if (SkyblockHud.config.renderer.hideFood && SkyblockHud.hasSkyblockScoreboard()) { ci.cancel(); if (pre(FOOD)) return; post(FOOD); } } - private boolean pre(RenderGameOverlayEvent.ElementType type) - { + private boolean pre(RenderGameOverlayEvent.ElementType type) { return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(eventParent, type)); } - private void post(RenderGameOverlayEvent.ElementType type) - { + + private void post(RenderGameOverlayEvent.ElementType type) { MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(eventParent, type)); } } |