aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/rift
diff options
context:
space:
mode:
authorMTOnline69 <97001154+MTOnline69@users.noreply.github.com>2024-10-05 09:59:13 +0100
committerGitHub <noreply@github.com>2024-10-05 10:59:13 +0200
commit96599f69ea7f22289a74c5c5e931d1001d73e42f (patch)
tree42277ced0db0cfe404e6dd7d266c331cff71230e /src/main/java/at/hannibal2/skyhanni/features/rift
parenta517ef456bde52aa391e31198c0facc87edaa7cf (diff)
downloadskyhanni-96599f69ea7f22289a74c5c5e931d1001d73e42f.tar.gz
skyhanni-96599f69ea7f22289a74c5c5e931d1001d73e42f.tar.bz2
skyhanni-96599f69ea7f22289a74c5c5e931d1001d73e42f.zip
Improvement: Option to hide other players while in Gunther's Race (#2655)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt
index cf729453f..5a3638101 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt
@@ -1,6 +1,7 @@
package at.hannibal2.skyhanni.features.rift.area.westvillage
import at.hannibal2.skyhanni.data.jsonobjects.repo.ParkourJson
+import at.hannibal2.skyhanni.events.CheckRenderEntityEvent
import at.hannibal2.skyhanni.events.ConfigLoadEvent
import at.hannibal2.skyhanni.events.IslandChangeEvent
import at.hannibal2.skyhanni.events.LorenzChatEvent
@@ -11,9 +12,11 @@ import at.hannibal2.skyhanni.features.rift.RiftAPI
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ColorUtils.toChromaColor
import at.hannibal2.skyhanni.utils.ConditionalUtils
+import at.hannibal2.skyhanni.utils.EntityUtils.isNPC
import at.hannibal2.skyhanni.utils.ParkourHelper
import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher
import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
+import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
@@ -106,6 +109,18 @@ object RiftGunthersRace {
}
@SubscribeEvent
+ fun onCheckRender(event: CheckRenderEntityEvent<*>) {
+ if (!isEnabled()) return
+ if (!config.hidePlayers) return
+ if (!RiftAPI.inRiftRace) return
+
+ val entity = event.entity
+ if (entity is EntityOtherPlayerMP && !entity.isNPC()) {
+ event.cancel()
+ }
+ }
+
+ @SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!isEnabled() || !RiftAPI.inRiftRace) return