diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-25 04:15:38 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-07-25 04:15:38 +0200 |
| commit | a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f (patch) | |
| tree | 3771b517ce72fe5c9a8b7e7020d15cafdf3a36b8 /src/main/java/at/hannibal2/skyhanni/features/nether | |
| parent | de61fd6bccbea2a3ceca5a0707a3176938f24ead (diff) | |
| download | skyhanni-a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f.tar.gz skyhanni-a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f.tar.bz2 skyhanni-a2ea62c88e4b7d25b27ccfde3d4d94d39c0a419f.zip | |
We do love LorenzTickEvent now
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
7 files changed, 17 insertions, 26 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt index 73e774f81..14ed0e2ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazes.kt @@ -14,7 +14,6 @@ import net.minecraft.entity.monster.EntityBlaze import net.minecraftforge.client.event.RenderLivingEvent import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class AshfangBlazes { @@ -22,13 +21,12 @@ class AshfangBlazes { private val blazeArmorStand = mutableMapOf<EntityBlaze, EntityArmorStand>() var nearAshfang = false - var tick = 0 @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - if (tick++ % 20 == 0) { + if (event.isMod(20)) { checkNearAshfang() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt index 76bf8a1c8..c9f585828 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangBlazingSouls.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether.ashfang import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.features.damageindicator.BossType import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager @@ -11,7 +12,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawString import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent import java.awt.Color class AshfangBlazingSouls { @@ -21,7 +21,7 @@ class AshfangBlazingSouls { private val souls = mutableListOf<EntityArmorStand>() @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return EntityUtils.getEntities<EntityArmorStand>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt index 70328e12b..92b699845 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangGravityOrbs.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether.ashfang import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.features.damageindicator.BossType import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager @@ -10,7 +11,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawString import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent import java.awt.Color class AshfangGravityOrbs { @@ -20,7 +20,7 @@ class AshfangGravityOrbs { private val orbs = mutableListOf<EntityArmorStand>() @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return EntityUtils.getEntities<EntityArmorStand>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt index 03211eb5b..dc4ff43d7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHideParticles.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.nether.ashfang import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.CheckRenderEntityEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent import at.hannibal2.skyhanni.features.damageindicator.BossType import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager @@ -10,18 +11,15 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class AshfangHideParticles { - - var tick = 0 private var nearAshfang = false @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return - if (tick++ % 60 == 0) { + if (event.isMod(60)) { nearAshfang = DamageIndicatorManager.getDistanceTo(BossType.NETHER_ASHFANG) < 40 } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt index c2290a0f2..47eb05f18 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.nether.ashfang import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.features.damageindicator.BossType import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager @@ -12,14 +13,13 @@ import at.hannibal2.skyhanni.utils.TimeUnit import at.hannibal2.skyhanni.utils.TimeUtils import net.minecraft.entity.item.EntityArmorStand import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent class AshfangNextResetCooldown { private var spawnTime = 1L @SubscribeEvent - fun renderOverlay(event: ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return if (EntityUtils.getEntities<EntityArmorStand>().any { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index a23623a82..579c6858b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -5,6 +5,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent +import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.nether.reputationhelper.dailykuudra.DailyKuudraBossHelper import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.DailyQuestHelper @@ -17,7 +18,6 @@ import at.hannibal2.skyhanni.utils.TabListData import com.google.gson.JsonObject import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { @@ -30,7 +30,6 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { private var display = emptyList<List<Any>>() private var dirty = true - private var tick = 0 init { skyHanniMod.loadModule(questHelper) @@ -60,7 +59,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { } @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!LorenzUtils.inSkyBlock) return if (LorenzUtils.skyBlockIsland != IslandType.CRIMSON_ISLE) return if (!SkyHanniMod.feature.misc.crimsonIsleReputationHelper) return @@ -69,8 +68,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { updateRender() } - tick++ - if (tick % 60 == 0) { + if (event.isMod(60)) { TabListData.getTabList() .filter { it.contains("Reputation:") } .forEach { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index c686ede33..048210679 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -21,14 +21,12 @@ import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.inventory.ContainerChest import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import net.minecraftforge.fml.common.gameevent.TickEvent class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { private val townBoardMage = LorenzVec(-138, 92, -755) private val townBoardBarbarian = LorenzVec(-572, 100, -687) - private var tick = 0 private val questLoader = QuestLoader(this) val quests = mutableListOf<Quest>() private val sacksCache = mutableMapOf<String, Long>() @@ -50,15 +48,14 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { } @SubscribeEvent - fun onTick(event: TickEvent.ClientTickEvent) { + fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return - tick++ - if (tick % 20 == 0) { + if (event.isMod(20)) { checkInventoryForTrophyFish() } - if (tick % 60 == 0) { + if (event.isMod(60)) { checkInventoryForFetchItem() } } |
