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 e5cc06820f..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 @@ -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,10 @@ 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) + + // 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, teleportee.yRot, teleportee.xRot) } }