-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7cdc98
commit c28870c
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/miyucomics/hexical/casting/patterns/colors/OpTranslateDye.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters