Skip to content

Commit

Permalink
Disable Enderman Teleportation
Browse files Browse the repository at this point in the history
#350

Original credit:

Co-authored-by: biscuut <20166775+biscuut@users.noreply.github.com>
  • Loading branch information
My-Name-Is-Jeff and biscuut committed Mar 21, 2023
1 parent 6c822d6 commit 44a9814
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,13 @@ object Config : Vigilant(
)
var customDamageSplash = 0

@Property(
type = PropertyType.SWITCH, name = "Disable Enderman Teleportation",
description = "Removes the enderman teleport effect.",
category = "Miscellaneous", subcategory = "Quality of Life"
)
var disableEndermanTeleport = false

@Property(
type = PropertyType.SWITCH, name = "Disable Night Vision",
description = "Removes the vanilla effects of Night Vision.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.client.event.RenderBlockOverlayEvent
import net.minecraftforge.client.event.RenderGameOverlayEvent
import net.minecraftforge.event.entity.EntityJoinWorldEvent
import net.minecraftforge.event.entity.living.EnderTeleportEvent
import net.minecraftforge.event.entity.player.ItemTooltipEvent
import net.minecraftforge.fml.common.Loader
import net.minecraftforge.fml.common.eventhandler.EventPriority
Expand Down Expand Up @@ -491,6 +492,13 @@ object MiscFeatures {
}
}

@SubscribeEvent(priority = EventPriority.LOW)
fun onEnderTeleport(event: EnderTeleportEvent) {
if (Utils.inSkyblock && Skytils.config.disableEndermanTeleport) {
event.isCanceled = true
}
}

class GolemSpawnTimerElement : GuiElement("Endstone Protector Spawn Timer", FloatPair(150, 20)) {
override fun render() {
val player = mc.thePlayer
Expand Down

0 comments on commit 44a9814

Please sign in to comment.