clean up some todos

This commit is contained in:
gamma-delta 2022-05-24 12:12:20 -05:00
parent d901b83732
commit cfbc2bd5f0
3 changed files with 9 additions and 12 deletions

View file

@ -18,7 +18,6 @@ data class HexPattern(public val startDir: HexDir, public val angles: MutableLis
// Two restrictions:
// - No adding a pos/dir pair we previously added
// - No backtracking
// TODO this doesn't seem to work very well
val linesSeen = mutableSetOf<Pair<HexCoord, HexDir>>()
var compass = this.startDir

View file

@ -71,13 +71,6 @@ object OpPlaceBlock : SpellOperator {
val placee = placeeStack.item as BlockItem
if (ctx.withdrawItem(placee, 1, false)) {
// https://github.com/VazkiiMods/Psi/blob/master/src/main/java/vazkii/psi/common/spell/trick/block/PieceTrickPlaceBlock.java#L143
// TODO do we need to add this back somehow
// val evt = BlockEvent.EntityPlaceEvent(
// BlockSnapshot.create(ctx.world.dimension(), ctx.world, pos),
// ctx.world.getBlockState(pos.above()),
// ctx.caster
// )
// MinecraftForge.EVENT_BUS.post(evt)
// we temporarily give the player the stack, place it using mc code, then give them the old stack back.
val oldStack = ctx.caster.getItemInHand(ctx.castingHand)

View file

@ -3,13 +3,13 @@ package at.petrak.hexcasting.common.casting.operators.stack
import at.petrak.hexcasting.api.misc.ManaConstants
import at.petrak.hexcasting.api.spell.OperationResult
import at.petrak.hexcasting.api.spell.Operator
import at.petrak.hexcasting.api.spell.getChecked
import at.petrak.hexcasting.api.spell.SpellDatum
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.api.spell.casting.OperatorSideEffect
import at.petrak.hexcasting.api.spell.casting.SpellContinuation
import at.petrak.hexcasting.api.spell.getChecked
import at.petrak.hexcasting.api.spell.mishaps.MishapInvalidIota
import at.petrak.hexcasting.api.spell.mishaps.MishapNotEnoughArgs
import at.petrak.hexcasting.api.spell.casting.SpellContinuation
import it.unimi.dsi.fastutil.ints.IntArrayList
import net.minecraft.network.chat.TranslatableComponent
import kotlin.math.abs
@ -18,9 +18,14 @@ import kotlin.math.roundToInt
// "lehmer code"
object OpAlwinfyHasAscendedToABeingOfPureMath : Operator {
override fun operate(continuation: SpellContinuation, stack: MutableList<SpellDatum<*>>, local: SpellDatum<*>, ctx: CastingContext): OperationResult {
override fun operate(
continuation: SpellContinuation,
stack: MutableList<SpellDatum<*>>,
local: SpellDatum<*>,
ctx: CastingContext
): OperationResult {
if (stack.isEmpty())
throw MishapNotEnoughArgs(1, 0) // todo: better message?
throw MishapNotEnoughArgs(1, 0)
val codeDouble = stack.getChecked<Double>(stack.lastIndex)
if (abs(codeDouble.roundToInt() - codeDouble) >= 0.05f)