From 999ff2256c1384a5ca4db2e7069207127404cfff Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:59:25 +1000 Subject: Backend: Use event.cancel() over event.isCanceled = true for LorenzEvents (#1915) --- .../java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt | 2 +- .../at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt | 2 +- src/main/java/at/hannibal2/skyhanni/features/misc/LesserOrbHider.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt | 2 +- src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt | 6 +++--- .../skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt | 2 +- .../skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt | 2 +- .../at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt index 45a3b52b8..3bfa54c7b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt @@ -55,7 +55,7 @@ object BetterWikiFromMenus { if (inSBGuideInventory && config.sbGuide) { val wikiSearch = itemClickedName.removeColor().replace("✔ ", "").replace("✖ ", "") WikiManager.sendWikiMessage(wikiSearch, autoOpen = config.menuOpenWiki) - event.isCanceled = true + event.cancel() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt index 5f3d71fa3..6fad15f8d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ExpOrbsOnGroundHider.kt @@ -16,7 +16,7 @@ object ExpOrbsOnGroundHider { if (!SkyHanniMod.feature.misc.hideExpBottles) return if (event.entity is EntityXPOrb) { - event.isCanceled = true + event.cancel() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/LesserOrbHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/LesserOrbHider.kt index bf3596127..36bfb3fb7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/LesserOrbHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LesserOrbHider.kt @@ -37,7 +37,7 @@ object LesserOrbHider { if (!isEnabled()) return if (event.entity in hiddenEntities) { - event.isCanceled = true + event.cancel() } } @@ -49,7 +49,7 @@ object LesserOrbHider { for (armorStand in hiddenEntities) { val distance = armorStand.distanceTo(event.location) if (distance < 4) { - event.isCanceled = true + event.cancel() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt index 5dc824499..123394e99 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt @@ -34,7 +34,7 @@ object MiscFeatures { EnumParticleTypes.EXPLOSION_LARGE, EnumParticleTypes.EXPLOSION_HUGE, EnumParticleTypes.EXPLOSION_NORMAL, - -> event.isCanceled = true + -> event.cancel() else -> {} } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt index 17ec66e2d..990f1a8b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt @@ -20,13 +20,13 @@ object ParticleHider { fun onReceiveParticle(event: ReceiveParticleEvent) { val distanceToPlayer = event.distanceToPlayer if (SkyHanniMod.feature.misc.particleHiders.hideFarParticles && distanceToPlayer > 40 && !inM7Boss()) { - event.isCanceled = true + event.cancel() return } val type = event.type if (SkyHanniMod.feature.misc.particleHiders.hideCloseRedstoneParticles && type == EnumParticleTypes.REDSTONE && distanceToPlayer < 2) { - event.isCanceled = true + event.cancel() return } @@ -34,7 +34,7 @@ object ParticleHider { for (entity in EntityUtils.getEntities()) { val distance = entity.getLorenzVec().distance(event.location) if (distance < 5) { - event.isCanceled = true + event.cancel() return } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt index 811e16b37..a29bcecc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PrivateIslandNoPickaxeAbility.kt @@ -23,7 +23,7 @@ object PrivateIslandNoPickaxeAbility { when (event.itemInHand?.getItemCategoryOrNull()) { ItemCategory.GAUNTLET, ItemCategory.PICKAXE, ItemCategory.DRILL -> { - event.isCanceled = true + event.cancel() } else -> {} diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt index b42266f54..05a10afe7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/teleportpad/TeleportPadCompactName.kt @@ -34,7 +34,7 @@ object TeleportPadCompactName { val name = entity.name noNamePattern.matchMatcher(name) { - event.isCanceled = true + event.cancel() } namePattern.matchMatcher(name) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index 918a19fcd..56165f54f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -313,7 +313,7 @@ object TrevorFeatures { if (!config.trapperTalkCooldown) return val entity = event.entity if (entity is EntityArmorStand && entity.name == "§e§lCLICK") { - event.isCanceled = true + event.cancel() } } -- cgit