mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-08 19:38:57 +01:00
added even more API
This commit is contained in:
parent
09992023c8
commit
4e9d455d68
@ -0,0 +1,14 @@
|
||||
package de.florianmichael.viafabricplus.definition.v1_14_4;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
public class SoulSandVelocityHandler {
|
||||
|
||||
public static void handleVelocity(final Entity entity) {
|
||||
final Vec3d velocity = entity.getVelocity();
|
||||
|
||||
double multiplier = 0.4D;
|
||||
entity.setVelocity(velocity.getX() * multiplier, velocity.getY(), velocity.getZ() * multiplier);
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
package de.florianmichael.viafabricplus.injection.mixin.fixes.block;
|
||||
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import de.florianmichael.viafabricplus.definition.v1_14_4.SoulSandVelocityHandler;
|
||||
import de.florianmichael.vialoadingbase.ViaLoadingBase;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoulSandBlock;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@ -23,10 +23,7 @@ public class MixinSoulSandBlock extends Block {
|
||||
super.onEntityCollision(state, world, pos, entity);
|
||||
|
||||
if (ViaLoadingBase.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) {
|
||||
final Vec3d velocity = entity.getVelocity();
|
||||
|
||||
double multiplier = 0.4D;
|
||||
entity.setVelocity(velocity.getX() * multiplier, velocity.getY(), velocity.getZ() * multiplier);
|
||||
SoulSandVelocityHandler.handleVelocity(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user