aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java26
2 files changed, 16 insertions, 13 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java
index ee71a995..7a1be4de 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java
@@ -1,5 +1,6 @@
package io.github.moulberry.notenoughupdates.mixins;
+import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.miscfeatures.CustomItemEffects;
import io.github.moulberry.notenoughupdates.miscfeatures.DamageCommas;
import io.github.moulberry.notenoughupdates.overlays.BonemerangOverlay;
@@ -31,7 +32,7 @@ public abstract class MixinRendererLivingEntity<T extends EntityLivingBase> {
@Inject(method="getColorMultiplier", at=@At("HEAD"), cancellable = true)
public void getColorMultiplier(T entitylivingbaseIn, float lightBrightness,
float partialTickTime, CallbackInfoReturnable<Integer> cir) {
- if(BonemerangOverlay.INSTANCE.bonemeragedEntities.contains(entitylivingbaseIn)) {
+ if(BonemerangOverlay.INSTANCE.bonemeragedEntities.contains(entitylivingbaseIn) && NotEnoughUpdates.INSTANCE.config.itemOverlays.highlightTargeted) {
cir.setReturnValue(0x80ff9500);
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java
index e108e232..7d54cf47 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java
@@ -48,7 +48,7 @@ public class BonemerangOverlay extends TextOverlay{
}
private void updateOverlay(){
- if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableBonemerangOverlay){
+ if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableBonemerangOverlay && NotEnoughUpdates.INSTANCE.config.itemOverlays.highlightTargeted){
overlayStrings = null;
return;
}
@@ -89,23 +89,25 @@ public class BonemerangOverlay extends TextOverlay{
break;
}
- if(NotEnoughUpdates.INSTANCE.config.itemOverlays.highlightTargeted) {
- List<Entity> entities = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABBExcludingEntity(Minecraft.getMinecraft().thePlayer, bb);
- for(Entity entity : entities) {
- if(entity instanceof EntityLivingBase && !(entity instanceof EntityArmorStand) && !entity.isInvisible()) {
- if(!bonemeragedEntities.contains(entity)) {
- bonemeragedEntities.add((EntityLivingBase)entity);
- }
+
+ List<Entity> entities = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABBExcludingEntity(Minecraft.getMinecraft().thePlayer, bb);
+ for (Entity entity : entities) {
+ if (entity instanceof EntityLivingBase && !(entity instanceof EntityArmorStand) && !entity.isInvisible()) {
+ if (!bonemeragedEntities.contains(entity)) {
+ bonemeragedEntities.add((EntityLivingBase) entity);
}
}
}
+
position.translate(step.x, step.y, step.z);
}
+ if(NotEnoughUpdates.INSTANCE.config.itemOverlays.enableBonemerangOverlay) {
- map.put(1, EnumChatFormatting.GRAY+"Targets: "+ EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+bonemeragedEntities.size());
- for(int index : NotEnoughUpdates.INSTANCE.config.itemOverlays.bonemerangOverlayText) {
- if(map.containsKey(index)) {
- overlayStrings.add(map.get(index));
+ map.put(1, EnumChatFormatting.GRAY + "Targets: " + EnumChatFormatting.GOLD + EnumChatFormatting.BOLD + bonemeragedEntities.size());
+ for (int index : NotEnoughUpdates.INSTANCE.config.itemOverlays.bonemerangOverlayText) {
+ if (map.containsKey(index)) {
+ overlayStrings.add(map.get(index));
+ }
}
}