Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
Uraneptus committed Sep 16, 2024
1 parent 57f7934 commit d8d9d01
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Fabric/src/main/java/vazkii/neat/NeatFiberConfig.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
2 changes: 0 additions & 2 deletions Forge/src/main/java/vazkii/neat/NeatForgeConfig.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Xplat/src/main/java/vazkii/neat/HealthBarRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 0 additions & 2 deletions Xplat/src/main/java/vazkii/neat/NeatConfig.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package vazkii.neat;

import net.minecraft.world.entity.MobCategory;

import java.util.List;

public class NeatConfig {
Expand Down
16 changes: 9 additions & 7 deletions Xplat/src/main/java/vazkii/neat/mixin/EntityRendererMixin.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
}

0 comments on commit d8d9d01

Please sign in to comment.