aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenceBlocks.kt)39
3 files changed, 35 insertions, 21 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
index 6c536e28c..ea5c42911 100644
--- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
+++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
@@ -67,7 +67,7 @@ import at.hannibal2.skyhanni.features.rift.area.RiftLarva
import at.hannibal2.skyhanni.features.rift.area.colosseum.BlobbercystsHighlight
import at.hannibal2.skyhanni.features.rift.area.dreadfarm.RiftAgaricusCap
import at.hannibal2.skyhanni.features.rift.area.dreadfarm.VoltHighlighter
-import at.hannibal2.skyhanni.features.rift.area.livingcave.LivingCaveDefenceBlocks
+import at.hannibal2.skyhanni.features.rift.area.livingcave.LivingCaveDefenseBlocks
import at.hannibal2.skyhanni.features.rift.area.livingcave.LivingCaveLivingMetalHelper
import at.hannibal2.skyhanni.features.rift.area.livingcave.LivingMetalSuitProgress
import at.hannibal2.skyhanni.features.rift.area.mirrorverse.DanceRoomHelper
@@ -345,7 +345,7 @@ class SkyHanniMod {
loadModule(LivingMetalSuitProgress())
loadModule(VampireSlayerFeatures())
loadModule(BlobbercystsHighlight())
- loadModule(LivingCaveDefenceBlocks())
+ loadModule(LivingCaveDefenseBlocks())
loadModule(LivingCaveLivingMetalHelper())
init()
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java
index 393fb28dd..3fde81172 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java
+++ b/src/main/java/at/hannibal2/skyhanni/config/features/RiftConfig.java
@@ -471,14 +471,19 @@ public class RiftConfig {
@Expose
@ConfigOption(name = "Living Metal Helper", desc = "")
@Accordion
- public DefenceBlockConfig defenceBlockConfig = new DefenceBlockConfig();
+ public DefenseBlockConfig defenseBlockConfig = new DefenseBlockConfig();
- public static class DefenceBlockConfig {
+ public static class DefenseBlockConfig {
@Expose
- @ConfigOption(name = "Defence Blocks", desc = "Show a line between the defence blocks and the mob and highlight the blocks.")
+ @ConfigOption(name = "Defense Blocks", desc = "Show a line between Defense blocks and the mob and highlight the blocks.")
@ConfigEditorBoolean
- public boolean enabled = false;
+ public boolean enabled = true;
+
+ @Expose
+ @ConfigOption(name = "Hide Particles", desc = "Hide particles around Defense Blocks")
+ @ConfigEditorBoolean
+ public boolean hideParticles = false;
@Expose
@ConfigOption(name = "Color", desc = "Set the color of the lines, blocks and the entity.")
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenceBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
index 745246bef..120e77e4d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenceBlocks.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt
@@ -25,13 +25,13 @@ import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-class LivingCaveDefenceBlocks {
- private val config get() = RiftAPI.config.area.livingCaveConfig.defenceBlockConfig
- private var movingBlocks = mapOf<DefenceBlock, Long>()
- private var staticBlocks = emptyList<DefenceBlock>()
+class LivingCaveDefenseBlocks {
+ private val config get() = RiftAPI.config.area.livingCaveConfig.defenseBlockConfig
+ private var movingBlocks = mapOf<DefenseBlock, Long>()
+ private var staticBlocks = emptyList<DefenseBlock>()
// private var helpLocation = emptyList<LorenzVec>()
- class DefenceBlock(val entity: EntityOtherPlayerMP, val location: LorenzVec, var hidden: Boolean = false)
+ class DefenseBlock(val entity: EntityOtherPlayerMP, val location: LorenzVec, var hidden: Boolean = false)
@SubscribeEvent
fun onReceiveParticle(event: ReceiveParticleEvent) {
@@ -58,15 +58,22 @@ class LivingCaveDefenceBlocks {
// Ignore particles around blocks
if (staticBlocks.any { it.location.distance(location) < 3 }) {
- event.isCanceled = true
+ if (config.hideParticles) {
+ event.isCanceled = true
+ }
return
}
+ if (config.hideParticles) {
+ if (movingBlocks.keys.any { it.location.distance(location) < 3 }) {
+ event.isCanceled = true
+ }
+ }
if (event.type == EnumParticleTypes.CRIT_MAGIC) {
var entity: EntityOtherPlayerMP? = null
// read old entity data
- getNearestMovingDefenceBlock(location)?.let {
+ getNearestMovingDefenseBlock(location)?.let {
if (it.location.distance(location) < 0.5) {
movingBlocks = movingBlocks.editCopy {
it.hidden = true
@@ -84,10 +91,12 @@ class LivingCaveDefenceBlocks {
.minByOrNull { it.distanceTo(compareLocation) }
}
- val defenceBlock = entity?.let { DefenceBlock(it, location) } ?: return
+ val defenseBlock = entity?.let { DefenseBlock(it, location) } ?: return
- movingBlocks = movingBlocks.editCopy { this[defenceBlock] = System.currentTimeMillis() + 250 }
- event.isCanceled = true
+ movingBlocks = movingBlocks.editCopy { this[defenseBlock] = System.currentTimeMillis() + 250 }
+ if (config.hideParticles) {
+ event.isCanceled = true
+ }
}
}
@@ -114,9 +123,9 @@ class LivingCaveDefenceBlocks {
// spawn block
if (old == "air" && (new == "stained_glass" || new == "diamond_block")) {
- val entity = getNearestMovingDefenceBlock(location)?.entity ?: return
+ val entity = getNearestMovingDefenseBlock(location)?.entity ?: return
staticBlocks = staticBlocks.editCopy {
- add(DefenceBlock(entity, location))
+ add(DefenseBlock(entity, location))
RenderLivingEntityHelper.setEntityColor(
entity,
color.withAlpha(50)
@@ -125,16 +134,16 @@ class LivingCaveDefenceBlocks {
}
// despawn block
- val nearestBlock = getNearestStaticDefenceBlock(location)
+ val nearestBlock = getNearestStaticDefenseBlock(location)
if (new == "air" && location == nearestBlock?.location) {
staticBlocks = staticBlocks.editCopy { remove(nearestBlock) }
}
}
- private fun getNearestMovingDefenceBlock(location: LorenzVec) =
+ private fun getNearestMovingDefenseBlock(location: LorenzVec) =
movingBlocks.keys.filter { it.location.distance(location) < 15 }.minByOrNull { it.location.distance(location) }
- private fun getNearestStaticDefenceBlock(location: LorenzVec) =
+ private fun getNearestStaticDefenseBlock(location: LorenzVec) =
staticBlocks.filter { it.location.distance(location) < 15 }.minByOrNull { it.location.distance(location) }
@SubscribeEvent