From fd1b8fc9de58d28206e5f4718439e504c2058bb5 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 23 Sep 2026 22:35:24 +0300 Subject: [PATCH 1/2] fix: retain velocity after teleportation --- .../common/casting/actions/spells/great/OpTeleport.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt index e5cc06820f..1d7cd7180d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt @@ -12,14 +12,11 @@ import at.petrak.hexcasting.api.casting.mishaps.MishapImmuneEntity import at.petrak.hexcasting.api.misc.MediaConstants import at.petrak.hexcasting.api.mod.HexConfig import at.petrak.hexcasting.api.mod.HexTags -import at.petrak.hexcasting.xplat.IXplatAbstractions -import net.minecraft.core.BlockPos import net.minecraft.server.level.ServerLevel import net.minecraft.server.level.ServerPlayer -import net.minecraft.server.level.TicketType import net.minecraft.world.entity.Entity +import net.minecraft.world.entity.RelativeMovement import net.minecraft.world.item.enchantment.EnchantmentHelper -import net.minecraft.world.level.ChunkPos import net.minecraft.world.phys.Vec3 // TODO while we're making breaking changes I *really* want to have the vector in the entity's local space @@ -112,6 +109,9 @@ object OpTeleport : SpellAction { teleportee.stopRiding() if (!teleportee.type.`is`(HexTags.Entities.STICKY_TELEPORTERS)) teleportee.passengers.forEach(Entity::stopRiding) - teleportee.teleportTo(target.x, target.y, target.z) + + teleportee.teleportTo(world, target.x, target.y, target.z, + RelativeMovement.ALL, // use relative movement since it makes it so the velocity doesn't vanish. :mojank: + teleportee.yRot, teleportee.xRot) } } From 64a204bf6868865c15e84203e78575bbb0bea31f Mon Sep 17 00:00:00 2001 From: Robotgiggle Date: Wed, 23 Sep 2026 17:11:30 -0400 Subject: [PATCH 2/2] Update changelog, clarify behavior --- CHANGELOG.md | 1 + .../common/casting/actions/spells/great/OpTeleport.kt | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a9235ad30..6e496f6b92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Fixed - Fixed Great Spells causing a mishap when drawn without enlightenment even while parenthesized ([#1290](https://github.com/FallingColors/HexMod/pull/1290)) @Robotgiggle +- Fixed Blink and Greater Teleport cancelling all velocity when cast on a player ([#1310](https://github.com/FallingColors/HexMod/pull/1310)) @drtheodor ## `0.11.4` - 2026-08-26 diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt index 1d7cd7180d..2f19bb8051 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/great/OpTeleport.kt @@ -110,8 +110,9 @@ object OpTeleport : SpellAction { if (!teleportee.type.`is`(HexTags.Entities.STICKY_TELEPORTERS)) teleportee.passengers.forEach(Entity::stopRiding) + // we specify that this is relative movement so that it doesn't reset player velocity. :mojank: + // note that the coordinates here are still absolute, because vanilla relative teleports are weird teleportee.teleportTo(world, target.x, target.y, target.z, - RelativeMovement.ALL, // use relative movement since it makes it so the velocity doesn't vanish. :mojank: - teleportee.yRot, teleportee.xRot) + RelativeMovement.ALL, teleportee.yRot, teleportee.xRot) } }