Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b8cb13b
chore(l10n): update Norwegian Bokmål translation
hexxy-weblate Aug 29, 2026
f2fd1b1
chore(l10n): update Chinese (Simplified Han script) translation
hexxy-weblate Aug 29, 2026
7c7b1a0
chore(l10n): update translation files
hexxy-weblate Aug 29, 2026
b8552f7
chore(l10n): update translation files
hexxy-weblate Aug 29, 2026
8fed46b
chore(l10n): update French translation
hexxy-weblate Aug 29, 2026
1330ea8
chore(l10n): update translation files
hexxy-weblate Aug 29, 2026
9467a9b
chore(l10n): update translations (#1280)
object-Object Aug 29, 2026
edba45d
Only check for enlightenment when drawing outside parens (#1290)
Robotgiggle Sep 7, 2026
038ca4c
chore(l10n): update Norwegian Bokmål translation
hexxy-weblate Sep 9, 2026
50c0b54
chore(l10n): update Japanese translation
hexxy-weblate Sep 9, 2026
5b0b862
chore(l10n): update Chinese (Simplified Han script) translation
hexxy-weblate Sep 9, 2026
acf8ca8
chore(l10n): update Finnish translation
hexxy-weblate Sep 9, 2026
695ec95
chore(l10n): update French translation
hexxy-weblate Sep 9, 2026
ee5c320
chore(l10n): update English (Pirate) translation
hexxy-weblate Sep 9, 2026
f684e93
chore(l10n): update Swedish translation
hexxy-weblate Sep 9, 2026
bb32244
chore(l10n): update Spanish translation
hexxy-weblate Sep 9, 2026
b1a0739
chore(l10n): update Polish translation
hexxy-weblate Sep 9, 2026
81bb810
chore(l10n): update Russian translation
hexxy-weblate Sep 9, 2026
fbe014f
chore(l10n): update translations (#1286)
object-Object Sep 9, 2026
78b5190
chore(l10n): update Norwegian Bokmål translation
hexxy-weblate Sep 21, 2026
8ade6bc
chore(l10n): update Spanish translation
hexxy-weblate Sep 21, 2026
53659f6
chore(l10n): update Polish translation
hexxy-weblate Sep 21, 2026
ef98502
chore(l10n): update Russian translation
hexxy-weblate Sep 21, 2026
073bb14
chore(l10n): update translations (#1300)
object-Object Sep 21, 2026
ffa7c37
Make impulse cost calculation respect max magnitude (#1307)
beholderface Sep 22, 2026
4db93ab
fix: retain velocity after teleportation (#1310)
drtheodor Sep 23, 2026
e49b3ad
Add media costs to EMI flay mind recipes (#1323)
MEEPofFaith Oct 8, 2026
24f31a2
Tweak OpLightning implementation (#1304)
Robotgiggle Oct 11, 2026
37c1b66
Prevent variable-cost spells being made free with very small inputs (…
Robotgiggle Oct 12, 2026
6ebfa70
Allow anything with the right NBT to shift-scroll (#1329)
Robotgiggle Oct 13, 2026
14f9edd
Specify Modrinth dependency versions based on gradle.properties (#1319)
Robotgiggle Oct 16, 2026
31dff9d
chore(l10n): update Norwegian Bokmål translation
hexxy-weblate Oct 15, 2026
2a8ba65
chore(l10n): update Polish translation
hexxy-weblate Oct 15, 2026
afb3a7c
chore(l10n): update Russian translation
hexxy-weblate Oct 15, 2026
bf347b6
chore(l10n): update translations (#1306)
object-Object Oct 16, 2026
f9ea5f2
Ignore nonexistent actions when loading Great Spells from world data …
Robotgiggle Oct 16, 2026
2b61049
Sync Sentinel, Pigment and Altiora state correctly on Forge (#1331)
R0b0Li0n Oct 16, 2026
ac58272
Add contribution policy (#1349)
Robotgiggle Oct 22, 2026
e3e137c
Fix typo in continuation key (#1350)
hauveli Oct 22, 2026
c22c3a6
Fix thoth consuming one extra op per iteration (#1352)
Robotgiggle Oct 26, 2026
922c1fc
Merge branch 'main' into main-to-next
s5bug Oct 30, 2026
6ca2368
Update python version to fix hexdoc
Robotgiggle Oct 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.10
3.12.16
40 changes: 40 additions & 0 deletions AI_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# AI Contribution Policy

This project is built by people, and new contributors are always welcome. To keep it that way, every part of a contribution should come from you: issues, pull requests, descriptions, comments, and replies to review.

For the same reason, contributions from automated accounts, bots, or agents are not accepted.

If a maintainer believes a contribution was AI generated, they may close it without a detailed explanation.

Maintainers may sometimes get it wrong, and apologies in advance if this affects contributions made with good intentions. These are challenging times, and this project is making deliberate choices about how it evolves.

## What is not accepted

- Issues, pull requests, descriptions, commit messages, comments, and review replies that were not written by you, in your own words.
- Submissions from automated accounts, bots, agents, or any workflow where a human does not personally write and post each action.
- Code you cannot explain line by line and take responsibility for.
- Fixes for problems you have not reproduced and/or tested yourself.

Non-native English is welcome. Imperfect text written by you is always preferred over polished text you did not write.

## Your workflow is your business

What happens on your machine is not policed, will not be asked about, and does not need to be shared. What matters is what you submit. It must be yours, and you take full responsibility for it.

## Responsibility

By opening an issue, pull request, or any other submission, you affirm that:

- You wrote it yourself.
- You tested it and understand every part of it.
- You will respond to review yourself, in your own words.

## Enforcement

- Suspicion is enough. Maintainers do not need proof, and are not required to explain a closure.
- A closure is not an accusation and will not be debated in the thread.
- Automated accounts, spam, scams, and malicious content are blocked immediately. Repeated or deliberate violations will also result in a block.

The issue templates and contribution guidelines always apply.

This policy is based on the [Human Responsible policy, version 1.0.0](https://ai-policy.dev/policies/human-responsible/1.0.0) from 2026-09-20. Read more about this and other AI contribution policies on [ai-policy.dev](https://ai-policy.dev/).
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## General notes

- Test your changes to make sure everything actually works before submitting a PR
- Each PR should generally address one issue or introduce one feature (a set of closely related issues/features is OK)
- Make sure that your PR targets the correct branch (`main` for the 1.20.1 version of the mod, `1.21` for 1.21.1)
- Make sure to add a new line to the [changelog](CHANGELOG.md) describing the changes you made and linking to your PR
- When adding/changing ingame text, only update the `en_us` language file (translation is handled via [Weblate](https://weblate.hexxy.media/engage/hexcasting/))

## Licensing

By submitting a pull request or contributing code to this repository, you agree to license your contributions under the
MIT license and abide by the [AI Contribution Policy](AI_POLICY.md).
2 changes: 1 addition & 1 deletion Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies {

modCompileOnly "at.petra-k:paucal:$paucalVersion+$minecraftVersion-common"
// i do not know why the xplat and mod jars are in different coordinates
modCompileOnly "vazkii.patchouli:Patchouli-xplat:1.21-$patchouliVersion-SNAPSHOT"
modCompileOnly "vazkii.patchouli:Patchouli-xplat:1.21.1-$patchouliVersion-SNAPSHOT"
modCompileOnly "com.samsthenerd.inline:inline-common:1.21.1-1.2.2-74"

// === OPTIONAL DEPS ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import at.petrak.hexcasting.api.casting.mishaps.MishapEntityNotFound
import at.petrak.hexcasting.api.casting.mishaps.MishapInvalidIota
import at.petrak.hexcasting.api.casting.mishaps.MishapNotEnoughArgs
import at.petrak.hexcasting.api.utils.TreeList
import at.petrak.hexcasting.api.utils.asTranslatedComponent
import at.petrak.hexcasting.api.utils.validateIota
import com.mojang.datafixers.util.Either
import net.minecraft.core.BlockPos
Expand Down Expand Up @@ -305,6 +304,18 @@ fun List<Iota>.getEvaluatable(idx: Int, argc: Int = 0): Either<Iota, TreeList<Io

fun Iota?.orNull() = this ?: NullIota()

/**
* Converts to long while ensuring that the final result is always nonzero.
* Used when a spell's cost depends on an arbitrary multiplier provided by
* the player, so that an extremely small value doesn't make the spell free.
*/
fun Double.toNonZeroLong(): Long {
val result = this.roundToLong()
if (result == 0L)
return if (this >= 0) 1L else -1L
return result
}

// TODO do we make this work on lists
// there should probably be some way to abstract function application over lists, vecs, and numbers,
// and i bet it's fucking monads
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package at.petrak.hexcasting.api.casting.eval;

import at.petrak.hexcasting.api.casting.OperatorUtils;
import at.petrak.hexcasting.api.casting.ParticleSpray;
import at.petrak.hexcasting.api.casting.PatternShapeMatch;
import at.petrak.hexcasting.api.casting.eval.env.PlayerBasedCastEnv;
import at.petrak.hexcasting.api.casting.eval.vm.CastingImage;
import at.petrak.hexcasting.api.casting.mishaps.Mishap;
import at.petrak.hexcasting.api.casting.mishaps.MishapBadLocation;
Expand All @@ -12,10 +12,8 @@
import at.petrak.hexcasting.api.mod.HexTags;
import at.petrak.hexcasting.api.pigment.FrozenPigment;
import at.petrak.hexcasting.api.utils.HexUtils;
import at.petrak.hexcasting.common.lib.HexAttributes;
import at.petrak.hexcasting.xplat.IXplatAbstractions;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -35,7 +33,6 @@
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Predicate;

import static at.petrak.hexcasting.api.HexAPI.modLoc;
Expand Down Expand Up @@ -243,7 +240,8 @@ public boolean isEnlightened() {
* positive.
*/
public long extractMedia(long cost, boolean simulate) {
cost = (long) (cost * costModifier);
if (cost == 0) return 0;
cost = OperatorUtils.toNonZeroLong(cost * costModifier);
for (var extractMediaComponent : preMediaExtract)
cost = extractMediaComponent.onExtractMedia(cost, simulate);
cost = extractMediaEnvironment(cost, simulate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ data class FrameForEach(
.pushFrame(FrameForEach(data.tail(), code, contextStack, stashedStack, newAcc))
// and prep the Thoth'd code block for evaluation.
.pushFrame(FrameEvaluate(code, true))
Triple(stack, harness.image.withUsedOp(), cont2)
Triple(stack, harness.image, cont2)
} else {
// Else, restore the stashed stack, and dump our final list on top.
val stack = stashedStack.appended(ListIota(newAcc))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public boolean executable() {
}

var reqsEnlightenment = isOfTag(IXplatAbstractions.INSTANCE.getActionRegistry(), key,
HexTags.Actions.REQUIRES_ENLIGHTENMENT);
inParens ? HexTags.Actions.REQUIRES_ENLIGHTENMENT_IN_PARENS : HexTags.Actions.REQUIRES_ENLIGHTENMENT);

castedName = () -> HexAPI.instance().getActionI18n(key, reqsEnlightenment);
action = Objects.requireNonNull(IXplatAbstractions.INSTANCE.getActionRegistry().get(key)).action();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public static final class Actions {
* "am I not skilled enough" message
*/
public static final TagKey<ActionRegistryEntry> REQUIRES_ENLIGHTENMENT = create("requires_enlightenment");
/**
* Same as REQUIRES_ENLIGHTENMENT but applies to actions that take effect while parenthesized.
* The base mod does not have any actions meeting both criteria but future addons might.
*/
public static final TagKey<ActionRegistryEntry> REQUIRES_ENLIGHTENMENT_IN_PARENS = create("requires_enlightenment_in_parens");
/**
* Actions where the pattern is calculated per-world
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package at.petrak.hexcasting.client;

import at.petrak.hexcasting.api.mod.HexConfig;
import at.petrak.hexcasting.common.items.storage.ItemSpellbook;
import at.petrak.hexcasting.common.lib.HexDataComponents;
import at.petrak.hexcasting.common.lib.HexItemComponents;
import at.petrak.hexcasting.common.lib.HexItems;
import at.petrak.hexcasting.common.msgs.MsgShiftScrollC2S;
import at.petrak.hexcasting.xplat.IClientXplatAbstractions;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;

public class ShiftScrollListener {
private static double mainHandDelta = 0;
Expand Down Expand Up @@ -36,11 +39,11 @@ public static boolean onScroll(double delta, boolean needsSneaking, boolean allo
return false;
}

if (IsScrollableItem(player.getMainHandItem().getItem())) {
mainHandDelta += delta * getScrollModifier(player.getMainHandItem().getItem(), allowInverting);
if (isScrollableStack(player.getMainHandItem())) {
mainHandDelta += delta * getScrollModifier(player.getMainHandItem(), allowInverting);
return true;
} else if (IsScrollableItem(player.getOffhandItem().getItem())) {
offHandDelta += delta * getScrollModifier(player.getOffhandItem().getItem(), allowInverting);
} else if (isScrollableStack(player.getOffhandItem())) {
offHandDelta += delta * getScrollModifier(player.getOffhandItem(), allowInverting);
return true;
}
}
Expand All @@ -58,17 +61,17 @@ public static void clientTickEnd() {
}
}

private static boolean IsScrollableItem(Item item) {
return item == HexItems.SPELLBOOK.get() || item == HexItems.ABACUS.get();
private static boolean isScrollableStack(ItemStack stack) {
return stack.has(HexDataComponents.SELECTED_SPELLBOOK_PAGE.get()) || stack.getItem() == HexItems.ABACUS;
}

private static double getScrollModifier(Item item, boolean allowInverting) {
private static double getScrollModifier(ItemStack stack, boolean allowInverting) {
if (!allowInverting) return 1;

if (item == HexItems.SPELLBOOK.get()) {
return HexConfig.client().invertSpellbookScrollDirection() ? -1 : 1;
} else if (item == HexItems.ABACUS.get()) {
if (stack.getItem() == HexItems.ABACUS) {
return HexConfig.client().invertAbacusScrollDirection() ? -1 : 1;
} else if (stack.has(HexDataComponents.SELECTED_SPELLBOOK_PAGE.get())) {
return HexConfig.client().invertSpellbookScrollDirection() ? -1 : 1;
} else {
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import at.petrak.hexcasting.api.casting.eval.vm.FrameForEach
import at.petrak.hexcasting.api.casting.eval.vm.SpellContinuation
import at.petrak.hexcasting.api.casting.getEvaluatable
import at.petrak.hexcasting.api.casting.getList
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.iota.ListIota
import at.petrak.hexcasting.api.casting.math.HexAngle
import at.petrak.hexcasting.api.casting.math.HexPattern
import at.petrak.hexcasting.api.casting.math.HexSignature
Expand Down Expand Up @@ -49,6 +51,17 @@ class SpecialHandlerForEach(val n: Int) : SpecialHandler {
val contextStack = stack.takeRight(n)
val stashedStack = stack.dropRight(n)

// if the pattern list is empty, directly return the modified data list to avoid VM overhead
// note that we still need to include a copy of the context stack before each datum
if (instrList.isEmpty()) {
val outList = mutableListOf<Iota>()
for (datum in datums) {
outList.addAll(contextStack.appended(datum))
}
val image2 = image.withUsedOp().copy(stack = stashedStack.appended(ListIota(outList)))
return OperationResult(image2, listOf(), continuation, HexEvalSounds.THOTH.get())
}

val frame = FrameForEach(datums, instrList, contextStack, stashedStack, TreeList.empty())
val image2 = image.withUsedOp().copy(stack = TreeList.empty())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getEntity
import at.petrak.hexcasting.api.casting.getVec3
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.toNonZeroLong
import at.petrak.hexcasting.api.misc.MediaConstants
import net.minecraft.world.entity.Entity
import net.minecraft.world.phys.Vec3
import kotlin.math.roundToLong

object OpAddMotion : SpellAction {
override val argc: Int
Expand All @@ -31,7 +31,7 @@ object OpAddMotion : SpellAction {

return SpellAction.Result(
Spell(target, shrunkMotion),
(2 * motion.length() * MediaConstants.DUST_UNIT).roundToLong(),
(2 * motion.length() * MediaConstants.DUST_UNIT).toNonZeroLong(),
listOf(
ParticleSpray(
target.position().add(0.0, target.eyeHeight / 2.0, 0.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import at.petrak.hexcasting.api.casting.getEntity
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.mishaps.MishapBadLocation
import at.petrak.hexcasting.api.casting.mishaps.MishapImmuneEntity
import at.petrak.hexcasting.api.casting.toNonZeroLong
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.common.casting.actions.spells.great.OpTeleport
import net.minecraft.world.entity.Entity
import net.minecraft.world.phys.Vec3
import kotlin.math.absoluteValue
import kotlin.math.roundToLong

object OpBlink : SpellAction {
override val argc = 2
Expand Down Expand Up @@ -54,7 +54,7 @@ object OpBlink : SpellAction {

return SpellAction.Result(
Spell(target, dvec),
(MediaConstants.SHARD_UNIT * delta.absoluteValue * 0.5).roundToLong(),
(MediaConstants.SHARD_UNIT * delta.absoluteValue * 0.5).toNonZeroLong(),
listOf(
ParticleSpray.cloud(targetMiddlePos, 2.0, 50),
ParticleSpray.burst(targetMiddlePos.add(dvec), 2.0, 100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getPositiveDoubleUnderInclusive
import at.petrak.hexcasting.api.casting.getVec3
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.toNonZeroLong
import at.petrak.hexcasting.api.misc.MediaConstants
import at.petrak.hexcasting.common.casting.actions.selectors.OpGetEntitiesBy
import net.minecraft.core.BlockPos
Expand Down Expand Up @@ -42,7 +43,7 @@ class OpExplode(val fire: Boolean) : SpellAction {
val cost = MediaConstants.DUST_UNIT * (3 * clampedStrength + if (fire) 1.0 else 0.125)
return SpellAction.Result(
Spell(pos, strength, this.fire),
cost.toLong(),
cost.toNonZeroLong(),
listOf(ParticleSpray.burst(pos, strength, 50))
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import at.petrak.hexcasting.api.casting.eval.CastingEnvironment
import at.petrak.hexcasting.api.casting.getPlayer
import at.petrak.hexcasting.api.casting.getPositiveDouble
import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.toNonZeroLong
import at.petrak.hexcasting.api.misc.MediaConstants
import at.petrak.hexcasting.api.pigment.FrozenPigment
import at.petrak.hexcasting.api.player.FlightAbility
Expand All @@ -23,7 +24,6 @@ import net.minecraft.world.item.ItemStack
import net.minecraft.world.phys.Vec3
import kotlin.math.max
import kotlin.math.roundToInt
import kotlin.math.roundToLong

class OpFlight(val type: Type) : SpellAction {
override val argc = 2
Expand All @@ -37,7 +37,7 @@ class OpFlight(val type: Type) : SpellAction {

// One block of radius, or one second of duration, costs 2 dust
val costUnit = 2 * MediaConstants.DUST_UNIT
var cost = (theArg * costUnit).roundToLong()
var cost = (theArg * costUnit).toNonZeroLong()
// Cost for anchorite does not decrease below 1 meter
if (type == Type.LimitRange) cost = max(cost, costUnit)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class OpPotionEffect(
}
return SpellAction.Result(
Spell(effect, target, duration, potency),
cost.toLong(),
cost.toNonZeroLong(),
listOf(ParticleSpray.cloud(target.position().add(0.0, target.eyeHeight / 2.0, 0.0), 1.0))
)
}

private class Spell(val effect: Holder<MobEffect>, val target: LivingEntity, val duration: Double, val potency: Double) :
RenderedSpell {
override fun cast(env: CastingEnvironment) {
if (duration > 1.0 / 20.0) {
if (duration >= 1.0 / 20.0) {
val effectInst = MobEffectInstance(effect, (duration * 20).toInt(), potency.toInt() - 1)
target.addEffect(effectInst)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import at.petrak.hexcasting.api.casting.iota.Iota
import at.petrak.hexcasting.api.casting.mishaps.MishapBadLocation
import at.petrak.hexcasting.api.misc.MediaConstants
import net.minecraft.core.BlockPos
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.entity.EntityType
import net.minecraft.world.entity.LightningBolt
import net.minecraft.world.phys.Vec3
Expand Down Expand Up @@ -37,8 +38,9 @@ object OpLightning : SpellAction {
override fun cast(env: CastingEnvironment) {

val lightning = LightningBolt(EntityType.LIGHTNING_BOLT, env.world)
lightning.setPosRaw(target.x, target.y, target.z)
env.world.addWithUUID(lightning) // why the hell is it called this it doesnt even involve a uuid
lightning.setPos(target.x, target.y, target.z)
lightning.cause = env.castingEntity as? ServerPlayer
env.world.addFreshEntity(lightning)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import net.minecraft.core.component.DataComponents
import net.minecraft.server.level.ServerLevel
import net.minecraft.server.level.ServerPlayer
import net.minecraft.world.entity.Entity
import net.minecraft.world.entity.RelativeMovement
import net.minecraft.world.item.enchantment.Enchantments
import net.minecraft.world.phys.Vec3

Expand Down Expand Up @@ -109,6 +110,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)
}
}
Loading
Loading