blob: befaa09f3712a5d9f906c16b2de56014010e55e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.features.dungeon.DungeonData
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.getLorenzVec
import net.minecraft.client.Minecraft
import net.minecraft.entity.projectile.EntitySmallFireball
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class ParticleHider {
fun inM7Boss() = LorenzUtils.inDungeons && DungeonData.dungeonFloor == "M7" && DungeonData.inBossRoom
@SubscribeEvent
fun onHypExplosions(event: ReceiveParticleEvent) {
val distanceToPlayer = event.distanceToPlayer
if (SkyHanniMod.feature.misc.hideFarParticles) {
if (distanceToPlayer > 40 && !inM7Boss()) {
event.isCanceled = true
return
}
}
val type = event.type
if (SkyHanniMod.feature.misc.hideCloseRedstoneparticles) {
if (type == EnumParticleTypes.REDSTONE) {
if (distanceToPlayer < 2) {
event.isCanceled = true
return
}
}
}
if (SkyHanniMod.feature.misc.hideFireballParticles) {
if (type == EnumParticleTypes.SMOKE_NORMAL || type == EnumParticleTypes.SMOKE_LARGE) {
for (entity in Minecraft.getMinecraft().theWorld.loadedEntityList.toMutableList()) {
if (entity !is EntitySmallFireball) continue
val distance = entity.getLorenzVec().distance(event.location)
if (distance < 5) {
event.isCanceled = true
return
}
}
}
}
}
}
|