Skip to content

Commit

Permalink
Minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
miyucomics committed Jul 24, 2024
1 parent e7cdc98 commit c28870c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package miyucomics.hexical.casting.patterns.pigment
package miyucomics.hexical.casting.patterns.colors

import at.petrak.hexcasting.api.spell.ConstMediaAction
import at.petrak.hexcasting.api.spell.asActionResult
Expand All @@ -16,6 +16,6 @@ class OpQueryPigment : ConstMediaAction {
val location = args.getVec3(0, argc)
val time = args.getDouble(1, argc)
val color = IXplatAbstractions.INSTANCE.getColorizer(ctx.caster).getColor(time.toFloat(), location)
return Vec3d(ColorHelper.Argb.getRed(color).toDouble(), ColorHelper.Argb.getGreen(color).toDouble(), ColorHelper.Argb.getBlue(color).toDouble()).multiply(1.0 / 255.0).asActionResult
return Vec3d(ColorHelper.Argb.getRed(color).toDouble() / 255.0, ColorHelper.Argb.getGreen(color).toDouble() / 255.0, ColorHelper.Argb.getBlue(color).toDouble() / 255.0).asActionResult
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package miyucomics.hexical.casting.patterns.colors

import at.petrak.hexcasting.api.spell.ConstMediaAction
import at.petrak.hexcasting.api.spell.asActionResult
import at.petrak.hexcasting.api.spell.casting.CastingContext
import at.petrak.hexcasting.api.spell.iota.Iota
import miyucomics.hexical.casting.iota.getTrueDye
import net.minecraft.util.math.Vec3d

class OpTranslateDye : ConstMediaAction {
override val argc = 1
override fun execute(args: List<Iota>, ctx: CastingContext): List<Iota> {
val dye = args.getTrueDye(0, argc).colorComponents
return Vec3d(dye[0].toDouble() / 255.0, dye[1].toDouble() / 255.0, dye[2].toDouble() / 255.0).asActionResult
}
}
4 changes: 4 additions & 0 deletions src/main/java/miyucomics/hexical/registry/HexicalBlocks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ import net.minecraft.util.registry.Registry
object HexicalBlocks {
val HEX_CANDLE_BLOCK: HexCandleBlock = HexCandleBlock()
val HEX_CANDLE_BLOCK_ENTITY: BlockEntityType<HexCandleBlockEntity> = BlockEntityType.Builder.create(::HexCandleBlockEntity, HEX_CANDLE_BLOCK).build(null)

val MAGE_BLOCK: MageBlock = MageBlock()
val MAGE_BLOCK_ENTITY: BlockEntityType<MageBlockEntity> = BlockEntityType.Builder.create(::MageBlockEntity, MAGE_BLOCK).build(null)

val MEDIA_JAR_BLOCK: MediaJarBlock = MediaJarBlock()

@JvmStatic
fun init() {
Registry.register(Registry.BLOCK, HexicalMain.id("hex_candle"), HEX_CANDLE_BLOCK)
Registry.register(Registry.BLOCK_ENTITY_TYPE, HexicalMain.id("hex_candle"), HEX_CANDLE_BLOCK_ENTITY)

Registry.register(Registry.BLOCK, HexicalMain.id("mage_block"), MAGE_BLOCK)
Registry.register(Registry.BLOCK_ENTITY_TYPE, HexicalMain.id("mage_block"), MAGE_BLOCK_ENTITY)

Registry.register(Registry.BLOCK, HexicalMain.id("media_jar"), MEDIA_JAR_BLOCK)
}

Expand Down

0 comments on commit c28870c

Please sign in to comment.