diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-06-05 22:32:03 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 14:32:03 +0200 |
commit | 406eaec8bd9e7ca630d1f79ffe2ddda8493778eb (patch) | |
tree | 1a3688b0629a924908476dc4787221596e92a0a4 /src/main/java/at/hannibal2/skyhanni/features/event | |
parent | e61f260fa2a094a43ebe1ab3d3305874dee6b716 (diff) | |
download | skyhanni-406eaec8bd9e7ca630d1f79ffe2ddda8493778eb.tar.gz skyhanni-406eaec8bd9e7ca630d1f79ffe2ddda8493778eb.tar.bz2 skyhanni-406eaec8bd9e7ca630d1f79ffe2ddda8493778eb.zip |
Fix: Crash and use less forge events (#1986)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt | 6 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt index d296680c0..85bb5fb74 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/UniqueGiftingOpportunitiesFeatures.kt @@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.events.EntityCustomNameUpdateEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent +import at.hannibal2.skyhanni.events.entity.EntityEnterWorldEvent import at.hannibal2.skyhanni.features.event.winter.UniqueGiftCounter import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha @@ -23,7 +24,6 @@ import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.entity.EntityLivingBase import net.minecraft.entity.item.EntityArmorStand import net.minecraft.entity.player.EntityPlayer -import net.minecraftforge.event.entity.EntityJoinWorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object UniqueGiftingOpportunitiesFeatures { @@ -72,13 +72,13 @@ object UniqueGiftingOpportunitiesFeatures { } @SubscribeEvent - fun onEntityJoinWorld(event: EntityJoinWorldEvent) { + fun onEntityJoinWorld(event: EntityEnterWorldEvent) { playerColor(event) val entity = event.entity as? EntityArmorStand ?: return analyzeArmorStand(entity) } - private fun playerColor(event: EntityJoinWorldEvent) { + private fun playerColor(event: EntityEnterWorldEvent) { if (event.entity is EntityOtherPlayerMP) { val entity = event.entity as EntityOtherPlayerMP if (entity.isNPC() || isIronman(entity) || isBingo(entity)) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt index f49376e37..a2842c5ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaAPI.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.Perk import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.events.diana.InquisitorFoundEvent +import at.hannibal2.skyhanni.events.entity.EntityEnterWorldEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.LorenzUtils @@ -11,7 +12,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.item.ItemStack -import net.minecraftforge.event.entity.EntityJoinWorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object DianaAPI { @@ -32,7 +32,7 @@ object DianaAPI { private fun hasSpadeInInventory() = InventoryUtils.getItemsInOwnInventory().any { it.isDianaSpade } @SubscribeEvent - fun onJoinWorld(event: EntityJoinWorldEvent) { + fun onJoinWorld(event: EntityEnterWorldEvent) { if (!LorenzUtils.inSkyBlock) return val entity = event.entity |