mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-10-20 14:16:26 -04:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91aac1d75e |
@@ -15,6 +15,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
@@ -29,4 +30,19 @@ public abstract class EntityMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "collide(Lnet/minecraft/world/phys/Vec3;)Lnet/minecraft/world/phys/Vec3;",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/entity/Entity;onGround()Z"
|
||||
)
|
||||
)
|
||||
private boolean cobblemon$forceOnGroundForStepUp(Entity entity) {
|
||||
if (entity instanceof PokemonEntity pokemon && entity.hasControllingPassenger()) {
|
||||
return true;
|
||||
}
|
||||
return entity.onGround();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5
-2
@@ -212,8 +212,11 @@ class HorseBehaviour : RidingBehaviour<HorseSettings, HorseState> {
|
||||
//Flag for determining if player is actively inputting
|
||||
var activeInput = false
|
||||
|
||||
var newVelocity = Vec3(state.rideVelocity.get().x, state.rideVelocity.get().y, state.rideVelocity.get().z).normalize().scale(vehicle.deltaMovement.length())
|
||||
//var newVelocity = vehicle.deltaMovement.normalize()
|
||||
// Gather the previous velocity and set the horizontal fields of the velocity vector to the magnitude of the
|
||||
// ones from deltaMovement. This is important as when a collision happens the Deltamovement will reflect it
|
||||
// but rideVelocity won't.
|
||||
var newVelocity = Vec3(state.rideVelocity.get().x, 0.0, state.rideVelocity.get().z).normalize().scale(vehicle.deltaMovement.horizontalDistance())
|
||||
newVelocity = newVelocity.add(0.0, state.rideVelocity.get().y, 0.0)
|
||||
|
||||
//speed up and slow down based on input
|
||||
if (driver.zza != 0.0f && state.stamina.get() > 0.0) {
|
||||
|
||||
Reference in New Issue
Block a user