mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-21 06:36:25 -04:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a1116c2af | ||
|
|
b41100f3d9 |
@@ -0,0 +1,11 @@
|
||||
package com.cobblemon.mod.common.api.events
|
||||
|
||||
import com.cobblemon.mod.common.api.events.client.ClientSendoutEvent
|
||||
import com.cobblemon.mod.common.api.reactive.CancelableObservable
|
||||
import com.cobblemon.mod.common.api.reactive.SimpleObservable
|
||||
|
||||
@Suppress("unused")
|
||||
object CobblemonClientEvents {
|
||||
@JvmField
|
||||
val CLIENT_SENDOUT = SimpleObservable<ClientSendoutEvent>()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.cobblemon.mod.common.api.events.client
|
||||
|
||||
import com.cobblemon.mod.common.api.events.Cancelable
|
||||
import com.cobblemon.mod.common.entity.pokemon.PokemonEntity
|
||||
import net.minecraft.client.util.math.MatrixStack
|
||||
import net.minecraft.util.math.Vec3d
|
||||
import org.joml.Vector3f
|
||||
|
||||
data class ClientSendoutEvent(var sendoutOffset: Vec3d, var startPos: Vec3d, val pokemon: PokemonEntity)
|
||||
+15
@@ -12,6 +12,8 @@ import com.bedrockk.molang.runtime.value.DoubleValue
|
||||
import com.bedrockk.molang.runtime.value.StringValue
|
||||
import com.cobblemon.mod.common.CobblemonSounds
|
||||
import com.cobblemon.mod.common.api.entity.PokemonSideDelegate
|
||||
import com.cobblemon.mod.common.api.events.CobblemonClientEvents
|
||||
import com.cobblemon.mod.common.api.events.client.ClientSendoutEvent
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.addFunctions
|
||||
import com.cobblemon.mod.common.api.molang.MoLangFunctions.getQueryStruct
|
||||
import com.cobblemon.mod.common.api.pokemon.PokemonSpecies
|
||||
@@ -134,6 +136,19 @@ class PokemonClientDelegate : PoseableEntityState<PokemonEntity>(), PokemonSideD
|
||||
if(!playedThrowingSound){
|
||||
client.soundManager.play(sound)
|
||||
playedThrowingSound = true
|
||||
sendOutPosition?.let {
|
||||
sendOutOffset?.let { it1 ->
|
||||
ClientSendoutEvent(
|
||||
it1,
|
||||
it,
|
||||
currentEntity
|
||||
)
|
||||
}
|
||||
}?.let {
|
||||
CobblemonClientEvents.CLIENT_SENDOUT.emit(
|
||||
it
|
||||
)
|
||||
}
|
||||
}
|
||||
lerpOnClient(POKEBALL_AIR_TIME) { ballOffset = it }
|
||||
ballRotOffset = ((Math.random()) * currentEntity.world.random.nextBetween(-15, 15)).toFloat()
|
||||
|
||||
Reference in New Issue
Block a user