diff options
author | DoKM <mcazzyman@gmail.com> | 2021-08-10 16:28:39 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-08-10 16:28:39 +0200 |
commit | 4993d127348f00bafd73fb0fe5b8cc6a0c2346d1 (patch) | |
tree | d9d55e95283f2ca8310bc4220b99106075d8f87a /src/main | |
parent | e234eb53d30b7005829e0d6dac4cd4748f46f57d (diff) | |
download | NotEnoughUpdates-4993d127348f00bafd73fb0fe5b8cc6a0c2346d1.tar.gz NotEnoughUpdates-4993d127348f00bafd73fb0fe5b8cc6a0c2346d1.tar.bz2 NotEnoughUpdates-4993d127348f00bafd73fb0fe5b8cc6a0c2346d1.zip |
Fix bug with bonemerang overlay
should be all good now
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRendererLivingEntity.java | 3 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/BonemerangOverlay.java | 26 |
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)); + } } } |