arrow vel fix also works for spectral arrows
This commit is contained in:
parent
d1640d956a
commit
42c1dc0e61
1 changed files with 11 additions and 7 deletions
|
@ -4,6 +4,7 @@ import at.petrak.hexcasting.api.HexAPI;
|
|||
import at.petrak.hexcasting.mixin.accessor.AccessorAbstractArrow;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.projectile.AbstractArrow;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public class VelocityFudging {
|
||||
|
@ -17,12 +18,15 @@ public class VelocityFudging {
|
|||
}
|
||||
});
|
||||
|
||||
HexAPI.instance().registerSpecialVelocityGetter(EntityType.ARROW, arrow -> {
|
||||
HexAPI.instance().registerSpecialVelocityGetter(EntityType.ARROW, VelocityFudging::arrowVelocitizer);
|
||||
HexAPI.instance().registerSpecialVelocityGetter(EntityType.SPECTRAL_ARROW, VelocityFudging::arrowVelocitizer);
|
||||
}
|
||||
|
||||
private static Vec3 arrowVelocitizer(AbstractArrow arrow) {
|
||||
if (((AccessorAbstractArrow) arrow).hex$isInGround()) {
|
||||
return Vec3.ZERO;
|
||||
} else {
|
||||
return arrow.getDeltaMovement();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue