From d8d9d01578e31035e0143076bfb10f9fc3ab06f4 Mon Sep 17 00:00:00 2001 From: Uraneptus Date: Mon, 16 Sep 2024 15:36:09 +0200 Subject: [PATCH] spotless --- .github/workflows/gradle.yml | 2 +- .../main/java/vazkii/neat/NeatFiberConfig.java | 1 + .../main/java/vazkii/neat/NeatForgeConfig.java | 2 -- .../main/java/vazkii/neat/HealthBarRenderer.java | 2 +- Xplat/src/main/java/vazkii/neat/NeatConfig.java | 2 -- .../vazkii/neat/mixin/EntityRendererMixin.java | 16 +++++++++------- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9e3d2a3..b8210e7 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -6,7 +6,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v2 with: diff --git a/Fabric/src/main/java/vazkii/neat/NeatFiberConfig.java b/Fabric/src/main/java/vazkii/neat/NeatFiberConfig.java index 764fb9f..e4f9d7d 100644 --- a/Fabric/src/main/java/vazkii/neat/NeatFiberConfig.java +++ b/Fabric/src/main/java/vazkii/neat/NeatFiberConfig.java @@ -1,6 +1,7 @@ package vazkii.neat; import net.minecraft.world.entity.MobCategory; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/Forge/src/main/java/vazkii/neat/NeatForgeConfig.java b/Forge/src/main/java/vazkii/neat/NeatForgeConfig.java index 5fd5363..4ebc3a6 100644 --- a/Forge/src/main/java/vazkii/neat/NeatForgeConfig.java +++ b/Forge/src/main/java/vazkii/neat/NeatForgeConfig.java @@ -1,7 +1,5 @@ package vazkii.neat; -import com.google.common.base.Enums; -import net.minecraft.world.entity.MobCategory; import net.minecraftforge.common.ForgeConfigSpec; import net.minecraftforge.common.ForgeConfigSpec.ConfigValue; import net.minecraftforge.fml.ModLoadingContext; diff --git a/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java b/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java index 853cab4..277ca2c 100644 --- a/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java +++ b/Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java @@ -118,7 +118,7 @@ private static int getColor(LivingEntity entity, boolean colorByType, boolean bo } else if (entity instanceof Monster) { r = 255; g = 0; - } + } return 0xff000000 | r << 16 | g << 8 | b; } else { float health = Mth.clamp(entity.getHealth(), 0.0F, entity.getMaxHealth()); diff --git a/Xplat/src/main/java/vazkii/neat/NeatConfig.java b/Xplat/src/main/java/vazkii/neat/NeatConfig.java index 8b9c76c..fe39fd6 100644 --- a/Xplat/src/main/java/vazkii/neat/NeatConfig.java +++ b/Xplat/src/main/java/vazkii/neat/NeatConfig.java @@ -1,7 +1,5 @@ package vazkii.neat; -import net.minecraft.world.entity.MobCategory; - import java.util.List; public class NeatConfig { diff --git a/Xplat/src/main/java/vazkii/neat/mixin/EntityRendererMixin.java b/Xplat/src/main/java/vazkii/neat/mixin/EntityRendererMixin.java index b7275ea..79c8179 100644 --- a/Xplat/src/main/java/vazkii/neat/mixin/EntityRendererMixin.java +++ b/Xplat/src/main/java/vazkii/neat/mixin/EntityRendererMixin.java @@ -1,23 +1,25 @@ package vazkii.neat.mixin; import com.mojang.blaze3d.vertex.PoseStack; + import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.world.entity.Entity; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import vazkii.neat.HealthBarRenderer; + import vazkii.neat.NeatConfig; @Mixin(EntityRenderer.class) public class EntityRendererMixin { - @Inject(method = "render(Lnet/minecraft/world/entity/Entity;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/EntityRenderer;renderNameTag(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/network/chat/Component;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V"), cancellable = true) - private void neat_disableNameTag(Entity $$0, float $$1, float $$2, PoseStack $$3, MultiBufferSource $$4, int $$5, CallbackInfo ci) { - if (NeatConfig.instance.disableNameTag()) { - ci.cancel(); - } - } + @Inject(method = "render(Lnet/minecraft/world/entity/Entity;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/EntityRenderer;renderNameTag(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/network/chat/Component;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V"), cancellable = true) + private void neat_disableNameTag(Entity $$0, float $$1, float $$2, PoseStack $$3, MultiBufferSource $$4, int $$5, CallbackInfo ci) { + if (NeatConfig.instance.disableNameTag()) { + ci.cancel(); + } + } }