-
-
Notifications
You must be signed in to change notification settings - Fork 216
/
Copy pathMiscFeatures.kt
56 lines (46 loc) · 1.71 KB
/
MiscFeatures.kt
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
51
52
53
54
55
56
package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.LorenzUtils
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.client.event.RenderBlockOverlayEvent
import net.minecraftforge.event.entity.living.EnderTeleportEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
/**
* I need these features in my dev env
*/
@SkyHanniModule
object MiscFeatures {
@SubscribeEvent
fun onEnderTeleport(event: EnderTeleportEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!SkyHanniMod.feature.combat.mobs.endermanTeleportationHider) return
event.isCanceled = true
}
@SubscribeEvent
fun onReceiveParticle(event: ReceiveParticleEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!SkyHanniMod.feature.misc.hideExplosions) return
when (event.type) {
EnumParticleTypes.EXPLOSION_LARGE,
EnumParticleTypes.EXPLOSION_HUGE,
EnumParticleTypes.EXPLOSION_NORMAL,
-> event.cancel()
else -> {}
}
}
@SubscribeEvent
fun onRenderBlockOverlay(event: RenderBlockOverlayEvent) {
if (!LorenzUtils.inSkyBlock) return
if (!SkyHanniMod.feature.misc.hideFireOverlay) return
if (event.overlayType == RenderBlockOverlayEvent.OverlayType.FIRE) {
event.isCanceled = true
}
}
@SubscribeEvent
fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) {
event.move(2, "mobs", "combat.mobs")
}
}