Compare commits

...
2 changed files with 12 additions and 6 deletions
+1
View File
@@ -72,6 +72,7 @@
- Fixed absence or incorrect mergers in spawning conditions, making max height/depth of conditions to use the min value instead
- Added stricter riding checks on server side to prevent possible packet forgery when player tries to ride pokemon
- Fixed Pokémon cries and animation sounds played from GUIs, such as the starter selection screen and the Pokédex, being tied to the Master volume slider instead of Friendly Creatures
- Fixed boat style mounts sprinting on their own after landing in water from jet flight
### Developer
- Bumped NeoForge to `21.1.195` to get access to MixinExtras `0.5` and the expressions annotation
@@ -37,6 +37,7 @@ import com.cobblemon.mod.common.util.writeRidingStats
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min
import net.minecraft.client.Minecraft
import net.minecraft.core.BlockPos
import net.minecraft.network.RegistryFriendlyByteBuf
import net.minecraft.util.Mth
@@ -94,12 +95,16 @@ class BoatBehaviour : RidingBehaviour<BoatSettings, BoatState> {
state.jumpBuffer.set(state.jumpBuffer.get() + 1)
}
// Only start sprinting on vehicle if the state has changed and the pokemon has atleast 1/3 stamina
if (driver.isSprinting && !state.isVehicleSprinting.get()) {
state.isVehicleSprinting.set(state.stamina.get() > 0.33f)
}
else if (!driver.isSprinting) {
state.isVehicleSprinting.set(false)
if (vehicle.level().isClientSide) {
// Check the keys instead of driver.isSprinting since that can still be true from a previous ride style
val tryingToSprint = Minecraft.getInstance().options.keySprint.isDown() && Minecraft.getInstance().options.keyUp.isDown()
// Only start sprinting on vehicle if the state has changed and the pokemon has atleast 1/3 stamina
if (tryingToSprint && !state.isVehicleSprinting.get()) {
state.isVehicleSprinting.set(state.stamina.get() > 0.33f)
}
else if (!tryingToSprint) {
state.isVehicleSprinting.set(false)
}
}
if (!state.isVehicleSprinting.get()) {