diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-28 19:44:11 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-28 19:44:11 +0200 |
| commit | b8bff2e2b2858b8f0136fe059cfae834f4a72936 (patch) | |
| tree | a4f4cc80da1fbf94b4e2e54094f5c5cded7604d1 /src/main/java/at/hannibal2/skyhanni/features/cosmetics | |
| parent | 5987dd18a6fc7709d079c81e2062c67b7e62581b (diff) | |
| download | skyhanni-b8bff2e2b2858b8f0136fe059cfae834f4a72936.tar.gz skyhanni-b8bff2e2b2858b8f0136fe059cfae834f4a72936.tar.bz2 skyhanni-b8bff2e2b2858b8f0136fe059cfae834f4a72936.zip | |
better description and code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/cosmetics')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt index 031ea9eb2..f7a28d78d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt @@ -5,21 +5,17 @@ import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.utils.EntityUtils -import at.hannibal2.skyhanni.utils.LorenzDebug +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine +import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.getLorenzVec import at.hannibal2.skyhanni.utils.getPrevLorenzVec import net.minecraft.client.Minecraft import net.minecraft.entity.projectile.EntityArrow -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor -import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine -import at.hannibal2.skyhanni.utils.SimpleTimeMark -import at.hannibal2.skyhanni.utils.TimeUtils import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.LinkedList -import kotlin.concurrent.thread -import kotlin.time.Duration import kotlin.time.DurationUnit import kotlin.time.toDuration @@ -39,13 +35,16 @@ class ArrowTrail { val secondsAlive = config.secondsAlive.toDouble().toDuration(DurationUnit.SECONDS) val time = SimpleTimeMark.now() val deathTime = time.plus(secondsAlive) - listAllArrow.removeIf { it.deathTime.isInPast()} - listYourArrow.removeIf { it.deathTime.isInPast()} + if (event.isMod(2)) { + listAllArrow.removeIf { it.deathTime.isInPast() } + listYourArrow.removeIf { it.deathTime.isInPast() } + } EntityUtils.getEntities<EntityArrow>().forEach { + val line = Line(it.getPrevLorenzVec(), it.getLorenzVec(), deathTime) if (it.shootingEntity == Minecraft.getMinecraft().thePlayer) { - listYourArrow.add(Line(it.getPrevLorenzVec(), it.getLorenzVec(), deathTime)) + listYourArrow.add(line) } else { - listAllArrow.add(Line(it.getPrevLorenzVec(), it.getLorenzVec(), deathTime)) + listAllArrow.add(line) } } } @@ -54,13 +53,13 @@ class ArrowTrail { fun onWorldRender(event: LorenzRenderWorldEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.enabled) return - val playerArrowColor = if (config.handlePlayerArrowsDifferently) config.playerArrowColor.toChromaColor() else - config.arrowColor.toChromaColor() - val arrowColor = config.arrowColor.toChromaColor() + val color = if (config.handlePlayerArrowsDifferently) config.playerArrowColor else config.arrowColor + val playerArrowColor = color.toChromaColor() listYourArrow.forEach { event.draw3DLine(it.start, it.end, playerArrowColor, config.lineWidth, true) } if (!config.hideOtherArrows) { + val arrowColor = config.arrowColor.toChromaColor() listAllArrow.forEach { event.draw3DLine(it.start, it.end, arrowColor, config.lineWidth, true) } @@ -68,8 +67,8 @@ class ArrowTrail { } @SubscribeEvent - fun onIslandChange(event: IslandChangeEvent){ + fun onIslandChange(event: IslandChangeEvent) { listAllArrow.clear() listYourArrow.clear() } -}
\ No newline at end of file +} |
