diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java | 14 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/cosmetics/ArrowTrail.kt | 33 |
2 files changed, 22 insertions, 25 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java index 5f21de197..86f60a8f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/MiscConfig.java @@ -496,17 +496,16 @@ public class MiscConfig { @Accordion public ArrowTrailConfig arrowTrailConfig = new ArrowTrailConfig(); - public static class ArrowTrailConfig{ + public static class ArrowTrailConfig { @Expose - @ConfigOption(name = "Enabled", desc = "Draw a colored line behind the player.") + @ConfigOption(name = "Enabled", desc = "Draw a colored line behind arrows in the air.") @ConfigEditorBoolean @FeatureToggle public boolean enabled = false; @Expose - @ConfigOption(name = "Hide Nonplayer Arrows", desc = "Only shows the arrows the player has shot") + @ConfigOption(name = "Hide Nonplayer Arrows", desc = "Only shows for arrows the player has shot.") @ConfigEditorBoolean - @FeatureToggle public boolean hideOtherArrows = true; @Expose @@ -515,19 +514,18 @@ public class MiscConfig { public String arrowColor = "0:200:85:255:85"; @Expose - @ConfigOption(name = "Player Arrows", desc = "Different Color for arrow that you have shot") + @ConfigOption(name = "Player Arrows", desc = "Different color for the line of arrows that you have shot.") @ConfigEditorBoolean - @FeatureToggle public boolean handlePlayerArrowsDifferently = false; @Expose - @ConfigOption(name = "Player Arrow Color", desc = "Color of the line.") + @ConfigOption(name = "Player Arrow Color", desc = "Color of the line of your own arrows.") @ConfigEditorColour public String playerArrowColor = "0:200:85:255:255"; @Expose @ConfigOption(name = "Time Alive", desc = "Time in seconds until the trail fades out.") - @ConfigEditorSlider(minStep = 0.1f, minValue = 0.1f, maxValue = 30) + @ConfigEditorSlider(minStep = 0.1f, minValue = 0.1f, maxValue = 10) public float secondsAlive = 0.5f; @Expose 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 +} |