blob: 96d1bb74ff1d7528f80a3c3282b444c7f1ea5b82 (
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
51
52
53
54
55
56
|
package at.hannibal2.skyhanni.features.itemabilities
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.ClickType
import at.hannibal2.skyhanni.events.BlockClickEvent
import at.hannibal2.skyhanni.events.ReceiveParticleEvent
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils
import at.hannibal2.skyhanni.utils.SpecialColour
import net.minecraft.client.Minecraft
import net.minecraft.util.EnumParticleTypes
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import java.awt.Color
class FireVeilWandParticles {
var lastClick = 0L
@SubscribeEvent
fun onChatPacket(event: ReceiveParticleEvent) {
if (!LorenzUtils.inSkyBlock) return
if (SkyHanniMod.feature.itemAbilities.fireVeilWandDisplay == 0) return
if (System.currentTimeMillis() > lastClick + 5_500) return
if (event.type == EnumParticleTypes.FLAME && event.count == 1 && event.speed == 0f && event.offset.isZero()) {
event.isCanceled = true
}
}
@SubscribeEvent
fun onBlockClick(event: BlockClickEvent) {
if (!LorenzUtils.inSkyBlock) return
if (event.clickType == ClickType.RIGHT_CLICK) {
val internalName = event.itemInHand?.getInternalName() ?: return
if (internalName == "FIRE_VEIL_WAND") {
lastClick = System.currentTimeMillis()
}
}
}
@SubscribeEvent
fun onRenderWorld(event: RenderWorldLastEvent) {
if (!LorenzUtils.inSkyBlock) return
if (SkyHanniMod.feature.itemAbilities.fireVeilWandDisplay != 1) return
if (System.currentTimeMillis() > lastClick + 5_500) return
val color =
Color(SpecialColour.specialToChromaRGB(SkyHanniMod.feature.itemAbilities.fireVeilWandDisplayColor), true)
RenderUtils.drawCircle(Minecraft.getMinecraft().thePlayer, event.partialTicks, 3.5, color)
}
}
|