-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic groundwork for Particle Action (unstable) and Visit Request…
… Action.
- Loading branch information
1 parent
9a4d327
commit b6159fb
Showing
3 changed files
with
54 additions
and
1 deletion.
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
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/kotlin/live/ixnoah/tapactions/actions/WorldActions.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,33 @@ | ||
package live.ixnoah.tapactions.actions | ||
|
||
import live.ixnoah.tapactions.ActionManager | ||
import net.minecraft.client.Minecraft | ||
import net.minecraft.util.EnumParticleTypes | ||
|
||
object WorldActions { | ||
private val actionParticle = { params: MutableMap<String, String> -> | ||
val particleType = params["particle"]?.let { EnumParticleTypes.valueOf(it) } | ||
|
||
if (particleType !== null) { | ||
Minecraft.getMinecraft().theWorld.spawnParticle( | ||
particleType, | ||
params["x"]?.toDoubleOrNull() ?: 0.00, | ||
params["y"]?.toDoubleOrNull() ?: 0.00, | ||
params["z"]?.toDoubleOrNull() ?: 0.00, | ||
params["ox"]?.toDoubleOrNull() ?: 0.00, | ||
params["oy"]?.toDoubleOrNull() ?: 0.00, | ||
params["oz"]?.toDoubleOrNull() ?: 0.00, | ||
) | ||
} | ||
} | ||
|
||
fun deploy() { | ||
ActionManager.registerAction( | ||
"tap:particle", | ||
actionParticle, | ||
mutableListOf( | ||
"particle", | ||
"x", "y", "z", | ||
)) | ||
} | ||
} |