-
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
c28870c
commit 5493e7e
Showing
4 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/main/java/miyucomics/hexical/casting/patterns/colors/OpConjureParticle.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,32 @@ | ||
package miyucomics.hexical.casting.patterns.colors | ||
|
||
import at.petrak.hexcasting.api.misc.MediaConstants | ||
import at.petrak.hexcasting.api.spell.ParticleSpray | ||
import at.petrak.hexcasting.api.spell.RenderedSpell | ||
import at.petrak.hexcasting.api.spell.SpellAction | ||
import at.petrak.hexcasting.api.spell.casting.CastingContext | ||
import at.petrak.hexcasting.api.spell.getVec3 | ||
import at.petrak.hexcasting.api.spell.iota.Iota | ||
import at.petrak.hexcasting.common.particles.ConjureParticleOptions | ||
import net.minecraft.util.math.Vec3d | ||
|
||
class OpConjureParticle : SpellAction { | ||
override val argc = 3 | ||
override fun execute(args: List<Iota>, ctx: CastingContext): Triple<RenderedSpell, Int, List<ParticleSpray>> { | ||
val pos = args.getVec3(0, argc) | ||
ctx.assertVecInRange(pos) | ||
val color = args.getVec3(1, argc) | ||
val velocity = args.getVec3(2, argc) | ||
return Triple(Spell(pos, color.multiply(255.0), velocity), MediaConstants.DUST_UNIT, listOf()) | ||
} | ||
|
||
private data class Spell(val position: Vec3d, val color: Vec3d, val velocity: Vec3d) : RenderedSpell { | ||
override fun cast(ctx: CastingContext) { | ||
ctx.world.addParticle( | ||
ConjureParticleOptions(color.x.toInt() shl 16 or color.y.toInt() shl 8 or color.z.toInt(), false), | ||
position.x, position.y, position.z, | ||
velocity.x, velocity.y, velocity.z | ||
) | ||
} | ||
} | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/resources/data/hexical/advancements/media_slurp.json
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,33 @@ | ||
{ | ||
"parent": "hexcasting:root", | ||
"criteria": { | ||
"sip": { | ||
"trigger": "minecraft:item_used_on_block", | ||
"conditions": { | ||
"location": { | ||
"block": { | ||
"blocks": [ | ||
"hexical:media_jar" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"display": { | ||
"announce_to_chat": true, | ||
"title": { | ||
"translate": "advancements.hexical.media_slurp.title" | ||
}, | ||
"description": { | ||
"translate": "advancements.hexical.media_slurp.description" | ||
}, | ||
"frame": "task", | ||
"hidden": true, | ||
"icon": { | ||
"item": "hexical:media_jar" | ||
}, | ||
"show_toast": true | ||
}, | ||
"requirements": [["sip"]] | ||
} |
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